Browse Source

Really fix qss forking

master
Denis Tereshkin 2 years ago
parent
commit
9e31193fbf
  1. 6
      src/Main.hs

6
src/Main.hs

@ -95,18 +95,18 @@ main = do @@ -95,18 +95,18 @@ main = do
")"
void $ withContext $ \ctx -> do
qssChannel <- newBoundedChan 50000
(forkTid, qssCh1, qssCh2) <- forkQssChannel qssChannel
bracket (startQuoteSourceServer
qssChannel
qssCh1
ctx
(quotesourceEndpoint cfg)
defaultServerSecurityParams)
stopQuoteSourceServer $ \_ -> withTickerInfoServer logger ctx (tisEndpoint cfg) $ \tisH -> do
withZMQTradeSink ctx (tradesinkDashboard cfg) logger $ \tsDashboard ->
withGotifyTradeSink (T.unpack $ gotifyUri cfg) (T.unpack $ gotifyToken cfg) logger $ \tsGotify -> do
(forkTid, qssCh1, qssCh2) <- forkQssChannel qssChannel
tickTable <- newTickTable
paper <- mkPaperBroker tickTable tisH qssCh2 (fromDouble 100000.0) ["demo"] (commissions cfg) logger
txml <- Connector.start logger tickTable cfg qssCh1 tisH
txml <- Connector.start logger tickTable cfg qssChannel tisH
bracket (startBrokerServer
[Connector.makeBrokerBackend txml (account cfg), paper]
ctx

Loading…
Cancel
Save