simplexmq-6.5.0.16: SimpleXMQ message broker
Copyright(c) simplex.chat
LicenseAGPL-3
Maintainerchat@simplex.chat
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simplex.Messaging.Server

Description

This module defines SMP protocol server with in-memory persistence and optional append only log of SMP queue records.

See https://github.com/simplex-chat/simplexmq/blob/master/protocol/simplex-messaging.md

Synopsis

Documentation

runSMPServer :: MsgStoreClass s => ServerConfig s -> Maybe AttachHTTP -> IO () Source #

Runs an SMP server using passed configuration.

See a full server here: https://github.com/simplex-chat/simplexmq/blob/master/apps/smp-server/Main.hs

runSMPServerBlocking :: MsgStoreClass s => TMVar Bool -> ServerConfig s -> Maybe AttachHTTP -> IO () Source #

Runs an SMP server using passed configuration with signalling.

This function uses passed TMVar to signal when the server is ready to accept TCP requests (True) and when it is disconnected from the TCP socket once the server thread is killed (False).

controlPortAuth :: Handle -> Maybe BasicAuth -> Maybe BasicAuth -> TVar CPClientRole -> BasicAuth -> IO () Source #

importMessages :: forall s. MsgStoreClass s => Bool -> s -> FilePath -> Maybe Int64 -> Bool -> IO MessageStats Source #

exportMessages :: forall s. MsgStoreClass s => Bool -> MsgStore s -> FilePath -> Bool -> IO () Source #

disconnectTransport :: Transport c => THandle v c 'TServer -> TVar SystemTime -> TVar SystemTime -> ExpirationConfig -> IO Bool -> IO () Source #

verifyCmdAuthorization :: Maybe (THandleAuth 'TServer) -> Maybe TAuthorizations -> ByteString -> CorrId -> APublicAuthKey -> Bool Source #

dummyVerifyCmd :: Maybe (THandleAuth 'TServer) -> Maybe TAuthorizations -> ByteString -> CorrId -> Bool Source #

randomId :: Int -> M s EntityId Source #

type AttachHTTP = Socket -> Context -> IO () Source #

data MessageStats Source #

Constructors

MessageStats 

Fields

Instances

Instances details
Monoid MessageStats Source # 
Instance details

Defined in Simplex.Messaging.Server.MsgStore.Types

Semigroup MessageStats Source # 
Instance details

Defined in Simplex.Messaging.Server.MsgStore.Types

Show MessageStats Source # 
Instance details

Defined in Simplex.Messaging.Server.MsgStore.Types

Methods

showsPrec :: Int -> MessageStats -> ShowS

show :: MessageStats -> String

showList :: [MessageStats] -> ShowS