simplexmq-0.4.1: SimpleXMQ message broker
Copyright(c) simplex.chat
LicenseAGPL-3
Maintainerchat@simplex.chat
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
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 :: (MonadRandom m, MonadUnliftIO m) => ServerConfig -> m () 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 :: (MonadRandom m, MonadUnliftIO m) => TMVar Bool -> ServerConfig -> m () 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).