extended-0.1.0: Extended versions of common modules
Safe HaskellSafe-Inferred
LanguageGHC2021

Network.AMQP.Extended

Synopsis

Documentation

data RabbitMqHooks m Source #

Constructors

RabbitMqHooks 

Fields

  • onNewChannel :: Channel -> m ()

    Called whenever there is a new channel. At any time there should be at max 1 open channel. Perhaps this would need to change in future.

  • onConnectionClose :: m ()

    Called when connection is closed. Any exceptions thrown by this would be logged and ignored.

  • onChannelException :: SomeException -> m ()

    Called when the channel is closed. Any exceptions thrown by this would be logged and ignored.

data AmqpEndpoint Source #

When admin opts are needed use `AmqpEndpoint Identity`, otherwise use `AmqpEndpoint NoAdmin`.

Constructors

AmqpEndpoint 

Fields

withConnection :: forall m a. (MonadIO m, MonadMask m) => Logger -> AmqpEndpoint -> (Connection -> m a) -> m a Source #

Connects with RabbitMQ and opens a channel.

openConnectionWithRetries :: forall m. (MonadIO m, MonadMask m, MonadBaseControl IO m) => Logger -> AmqpEndpoint -> RabbitMqHooks m -> m () Source #

Connects with RabbitMQ and opens a channel. If the channel is closed for some reasons, reopens the channel. If the connection is closed for some reasons, keeps retrying to connect until it works.

mkRabbitMqChannelMVar :: Logger -> AmqpEndpoint -> IO (MVar Channel) Source #

Useful if the application only pushes into some queues.