<commit_before>{-# LANGUAGE AllowAmbiguousTypes   #-}
{-# LANGUAGE ConstraintKinds       #-}
{-# LANGUAGE FlexibleContexts      #-}
{-# LANGUAGE LambdaCase            #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables   #-}
{-# LANGUAGE TemplateHaskell       #-}

-- | Runners in various modes.

module Pos.Launcher.Runner
       (
         -- * High level runners
         runRawRealMode
       , runProductionMode
       , runStatsMode
       , runServiceMode

         -- * Service runners
       , runSupporterReal
       , runTimeSlaveReal
       , runTimeLordReal

       -- * Exported for custom usage in CLI utils
       , addDevListeners
       , setupLoggers
       , bracketDHTInstance
       , runKDHT
       , runOurDialog
       ) where

import           Control.Concurrent.MVar      (newEmptyMVar, newMVar, takeMVar,
                                               tryReadMVar)
import           Control.Concurrent.STM.TVar  (newTVar)
import           Control.Lens                 (each, to, (%~), (^..), (^?), _head, _tail)
import           Control.Monad                (fail)
import           Control.Monad.Catch          (bracket)
import           Control.Monad.Trans.Control  (MonadBaseControl)
import           Control.Monad.Trans.Resource (allocate, runResourceT)
import           Control.TimeWarp.Rpc         (Dialog, Transfer, commLoggerName,
                                               runDialog, runTransfer)
import           Control.TimeWarp.Timed       (MonadTimed, currentTime, fork, killThread,
                                               repeatForever, runTimedIO, runTimedIO, sec)

import           Data.List                    (nub)
import qualified Data.Time                    as Time
import           Formatting                   (build, sformat, shown, (%))
import           System.Wlog                  (LoggerName (..), WithLogger, logDebug,
                                               logInfo, logWarning, releaseAllHandlers,
                                               traverseLoggerConfig, usingLoggerName)
import           Universum

import           Pos.Binary                   ()
import           Pos.CLI                      (readLoggerConfig)
import           Pos.Communication            (MutSocketState, SysStartRequest (..),
                                               allListeners, newMutSocketState,
                                               noCacheMessageNames, sysStartReqListener,<commit_msg>Fix warning<commit_after>{-# LANGUAGE AllowAmbiguousTypes   #-}
{-# LANGUAGE ConstraintKinds       #-}
{-# LANGUAGE FlexibleContexts      #-}
{-# LANGUAGE LambdaCase            #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables   #-}
{-# LANGUAGE TemplateHaskell       #-}

-- | Runners in various modes.

module Pos.Launcher.Runner
       (
         -- * High level runners
         runRawRealMode
       , runProductionMode
       , runStatsMode
       , runServiceMode

         -- * Service runners
       , runSupporterReal
       , runTimeSlaveReal
       , runTimeLordReal

       -- * Exported for custom usage in CLI utils
       , addDevListeners
       , setupLoggers
       , bracketDHTInstance
       , runKDHT
       , runOurDialog
       ) where

import           Control.Concurrent.MVar      (newEmptyMVar, newMVar, takeMVar,
                                               tryReadMVar)
import           Control.Concurrent.STM.TVar  (newTVar)
import           Control.Lens                 (each, to, (%~), (^..), (^?), _head, _tail)
import           Control.Monad                (fail)
import           Control.Monad.Catch          (bracket)
import           Control.Monad.Trans.Control  (MonadBaseControl)
import           Control.Monad.Trans.Resource (runResourceT)
import           Control.TimeWarp.Rpc         (Dialog, Transfer, commLoggerName,
                                               runDialog, runTransfer)
import           Control.TimeWarp.Timed       (MonadTimed, currentTime, fork, killThread,
                                               repeatForever, runTimedIO, runTimedIO, sec)

import           Data.List                    (nub)
import qualified Data.Time                    as Time
import           Formatting                   (build, sformat, shown, (%))
import           System.Wlog                  (LoggerName (..), WithLogger, logDebug,
                                               logInfo, logWarning, releaseAllHandlers,
                                               traverseLoggerConfig, usingLoggerName)
import           Universum

import           Pos.Binary                   ()
import           Pos.CLI                      (readLoggerConfig)
import           Pos.Communication            (MutSocketState, SysStartRequest (..),
                                               allListeners, newMutSocketState,
                                               noCacheMessageNames, sysStartReqListener,
{'fraction_non_alphanumeric': 0.07548309178743962, 'fraction_numerical': 0.0, 'mean_word_length': 1.3383529411764705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '893968', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1191, 'n_words': 257}