From 30d059670422c08de63221ca832c6cabbd2d2f9e Mon Sep 17 00:00:00 2001 From: Denis Tereshkin Date: Sun, 26 Sep 2021 12:14:02 +0700 Subject: [PATCH] BrokerClient: more debugging output --- src/ATrade/Broker/Client.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ATrade/Broker/Client.hs b/src/ATrade/Broker/Client.hs index 6854c2d..6f4ebcf 100644 --- a/src/ATrade/Broker/Client.hs +++ b/src/ATrade/Broker/Client.hs @@ -99,6 +99,7 @@ notificationThread clientIdentity callbacks ctx ep killMv = flip finally (return setTcpKeepAliveIdle (restrict 60) sock setTcpKeepAliveInterval (restrict 10) sock connect sock $ T.unpack ep + debugM "Broker.Client" $ "Subscribing: [" <> T.unpack clientIdentity <> "]" subscribe sock $ T.encodeUtf8 clientIdentity whileM_ (isNothing <$> tryReadMVar killMv) $ do msg <- receiveMulti sock @@ -109,7 +110,13 @@ notificationThread clientIdentity callbacks ctx ep killMv = flip finally (return _ -> return () -startBrokerClient :: B.ByteString -> Context -> T.Text -> T.Text -> [NotificationCallback] -> ClientSecurityParams -> IO BrokerClientHandle +startBrokerClient :: B.ByteString -- ^ Socket Identity + -> Context -- ^ ZeroMQ context + -> T.Text -- ^ Broker endpoing + -> T.Text -- ^ Notification endpoing + -> [NotificationCallback] -- ^ List of notification callbacks + -> ClientSecurityParams -- ^ + -> IO BrokerClientHandle startBrokerClient socketIdentity ctx endpoint notifEndpoint notificationCallbacks secParams = do idCounter <- newIORef 1 compMv <- newEmptyMVar