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

Simplex.Messaging.Agent

Description

This module defines SMP protocol agent with SQLite persistence.

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

Synopsis

Documentation

runSMPAgent :: (MonadRandom m, MonadUnliftIO m) => AgentConfig -> m () Source #

Runs an SMP agent as a TCP service using passed configuration.

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

runSMPAgentBlocking :: (MonadRandom m, MonadUnliftIO m) => TMVar Bool -> AgentConfig -> m () Source #

Runs an SMP agent as a TCP service 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).

getSMPAgentClient :: (MonadUnliftIO m, MonadReader Env m) => m AgentClient Source #

Creates an SMP agent instance that receives commands and sends responses via TBQueues.

runSMPAgentClient :: (MonadUnliftIO m, MonadReader Env m) => AgentClient -> m () Source #

Runs an SMP agent instance that receives commands and sends responses via TBQueues.