|
|
|
@ -34,7 +34,7 @@ startQuoteSourceClient chan tickers ctx endpoint = do |
|
|
|
finally (clientThread sock) (cleanup compMv sock) |
|
|
|
finally (clientThread sock) (cleanup compMv sock) |
|
|
|
return QuoteSourceClientHandle { tid = tid, completionMvar = compMv } |
|
|
|
return QuoteSourceClientHandle { tid = tid, completionMvar = compMv } |
|
|
|
where |
|
|
|
where |
|
|
|
clientThread sock = do |
|
|
|
clientThread sock = forever $ do |
|
|
|
evs <- poll 200 [Sock sock [In] Nothing] |
|
|
|
evs <- poll 200 [Sock sock [In] Nothing] |
|
|
|
when ((L.length . L.head) evs > 0) $ do |
|
|
|
when ((L.length . L.head) evs > 0) $ do |
|
|
|
rawTick <- fmap BL.fromStrict <$> receiveMulti sock |
|
|
|
rawTick <- fmap BL.fromStrict <$> receiveMulti sock |
|
|
|
|