Copyright | (c) simplex.chat |
---|---|
License | AGPL-3 |
Maintainer | chat@simplex.chat |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module defines SMP protocol agent with SQLite persistence.
See https://github.com/simplex-chat/simplexmq/blob/master/protocol/agent-protocol.md
Synopsis
- runSMPAgent :: (MonadRandom m, MonadUnliftIO m) => AgentConfig -> m ()
- runSMPAgentBlocking :: (MonadRandom m, MonadUnliftIO m) => TMVar Bool -> AgentConfig -> m ()
- getSMPAgentClient :: (MonadUnliftIO m, MonadReader Env m) => m AgentClient
- runSMPAgentClient :: (MonadUnliftIO m, MonadReader Env m) => AgentClient -> m ()
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 TBQueue
s.
runSMPAgentClient :: (MonadUnliftIO m, MonadReader Env m) => AgentClient -> m () Source #
Runs an SMP agent instance that receives commands and sends responses via TBQueue
s.