rename Config to ServerConfig

This commit is contained in:
Evgeny Poberezkin
2020-12-25 14:21:28 +00:00
parent 6249bf749e
commit 2ed24e683e
4 changed files with 9 additions and 9 deletions

View File

@@ -35,8 +35,8 @@ import UnliftIO.Exception
import UnliftIO.IO
import UnliftIO.STM
runSMPServer :: (MonadRandom m, MonadUnliftIO m) => Config -> m ()
runSMPServer cfg@Config {tcpPort} = do
runSMPServer :: (MonadRandom m, MonadUnliftIO m) => ServerConfig -> m ()
runSMPServer cfg@ServerConfig {tcpPort} = do
env <- newEnv cfg
runReaderT smpServer env
where

View File

@@ -15,7 +15,7 @@ import Simplex.Messaging.Server.QueueStore.STM
import Simplex.Messaging.Server.Transmission
import UnliftIO.STM
data Config = Config
data ServerConfig = ServerConfig
{ tcpPort :: ServiceName,
tbqSize :: Natural,
queueIdBytes :: Int,
@@ -23,7 +23,7 @@ data Config = Config
}
data Env = Env
{ config :: Config,
{ config :: ServerConfig,
server :: Server,
queueStore :: QueueStore,
msgStore :: STMMsgStore,
@@ -66,7 +66,7 @@ newSubscription = do
delivered <- newEmptyTMVar
return Sub {subThread = NoSub, delivered}
newEnv :: (MonadUnliftIO m, MonadRandom m) => Config -> m Env
newEnv :: (MonadUnliftIO m, MonadRandom m) => ServerConfig -> m Env
newEnv config = do
server <- atomically $ newServer (tbqSize config)
queueStore <- atomically newQueueStore