|
|
|
@ -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 |
|
|
|
|