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

Loading…
Cancel
Save