-
Notifications
You must be signed in to change notification settings - Fork 2
/
Executables.hs
34 lines (28 loc) · 1.22 KB
/
Executables.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
module Executables
( execute
) where
import Prelude hiding (log)
import Control.Monad.Reader
import Streamly.Prelude as S
import qualified Streamly.Internal.Prelude as SIP
import Dolla.Common.Logging.Core
import Dolla.Common.Executable.Executable
import Dolla.Consensus.Proposing.Staging.Execution.Environment.EventStore.Dolla.Pipeline (staging)
import Dolla.Consensus.Proposing.Staging.Execution.Environment.EventStore.Settings
import Dolla.Consensus.Proposing.Staging.Execution.Environment.EventStore.Dependencies
import Dolla.Consensus.Proposing.Staging.Execution.Environment.EventStore.Dolla.Junction
execute :: IO ()
execute
= executeMicroservice
(\Settings {logger} -> logger)
executePipeline
where
executePipeline :: ReaderT Dependencies IO ()
executePipeline = do
dependencies @ Dependencies {eventStoreClient,nodeId,logger} <- ask
withReaderT (const (nodeId, eventStoreClient)) loadJunctionInEventStore
log logger INFO "Pipeline Starting"
drain $ SIP.runReaderT dependencies staging
log logger INFO "End Of Pipeline"