Browse Source

Broker client: debug logging

master
Denis Tereshkin 9 years ago
parent
commit
c84926e8ba
  1. 5
      src/ATrade/Broker/Client.hs

5
src/ATrade/Broker/Client.hs

@ -44,7 +44,10 @@ brokerClientThread :: Context -> T.Text -> MVar BrokerServerRequest -> MVar Brok
brokerClientThread ctx ep cmd resp comp killMv = finally brokerClientThread' cleanup brokerClientThread ctx ep cmd resp comp killMv = finally brokerClientThread' cleanup
where where
cleanup = putMVar comp () cleanup = putMVar comp ()
brokerClientThread' = whileM_ (isNothing <$> tryReadMVar killMv) $ withSocket ctx Req (\sock -> do brokerClientThread' = whileM_ (isNothing <$> tryReadMVar killMv) $ handle
(\e -> do
warningM "Strategy" $ "Broker client: exception: " ++ show (e :: SomeException)
throwIO e) $ withSocket ctx Req (\sock -> do
connect sock $ T.unpack ep connect sock $ T.unpack ep
whileM_ (isNothing <$> tryReadMVar killMv) $ do whileM_ (isNothing <$> tryReadMVar killMv) $ do
request <- takeMVar cmd request <- takeMVar cmd

Loading…
Cancel
Save