|
|
|
@ -66,7 +66,6 @@ import System.ZMQ4 (Context, Event (In), |
|
|
|
setZapDomain, socket) |
|
|
|
setZapDomain, socket) |
|
|
|
import System.ZMQ4.ZAP (zapApplyCertificate) |
|
|
|
import System.ZMQ4.ZAP (zapApplyCertificate) |
|
|
|
|
|
|
|
|
|
|
|
newtype OrderIdGenerator = IO OrderId |
|
|
|
|
|
|
|
type PeerId = B.ByteString |
|
|
|
type PeerId = B.ByteString |
|
|
|
|
|
|
|
|
|
|
|
data FullOrderId = FullOrderId ClientIdentity OrderId |
|
|
|
data FullOrderId = FullOrderId ClientIdentity OrderId |
|
|
|
@ -276,6 +275,7 @@ brokerServerThread state logger = finally brokerServerThread' cleanup |
|
|
|
return ResponseOk |
|
|
|
return ResponseOk |
|
|
|
_ -> return $ ResponseError "Unknown order" |
|
|
|
_ -> return $ ResponseError "Unknown order" |
|
|
|
RequestNotifications sqnum clientIdentity initialSqnum -> do |
|
|
|
RequestNotifications sqnum clientIdentity initialSqnum -> do |
|
|
|
|
|
|
|
log Debug "Broker.Server" $ "Request: notifications:" <> (T.pack . show) request |
|
|
|
maybeNs <- M.lookup clientIdentity . pendingNotifications <$> readIORef state |
|
|
|
maybeNs <- M.lookup clientIdentity . pendingNotifications <$> readIORef state |
|
|
|
case maybeNs of |
|
|
|
case maybeNs of |
|
|
|
Just ns -> do |
|
|
|
Just ns -> do |
|
|
|
@ -284,6 +284,7 @@ brokerServerThread state logger = finally brokerServerThread' cleanup |
|
|
|
return $ ResponseNotifications . L.reverse $ filtered |
|
|
|
return $ ResponseNotifications . L.reverse $ filtered |
|
|
|
Nothing -> return $ ResponseNotifications [] |
|
|
|
Nothing -> return $ ResponseNotifications [] |
|
|
|
RequestCurrentSqnum sqnum clientIdentity -> do |
|
|
|
RequestCurrentSqnum sqnum clientIdentity -> do |
|
|
|
|
|
|
|
log Debug "Broker.Server" $ "Request: current sqnum:" <> (T.pack . show) request |
|
|
|
sqnumMap <- notificationSqnum <$> readIORef state |
|
|
|
sqnumMap <- notificationSqnum <$> readIORef state |
|
|
|
notifMap <- pendingNotifications <$> readIORef state |
|
|
|
notifMap <- pendingNotifications <$> readIORef state |
|
|
|
case M.lookup clientIdentity notifMap of |
|
|
|
case M.lookup clientIdentity notifMap of |
|
|
|
|