amqp-worker-1.0.0: Type-safe AMQP workers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.AMQP.Worker.Connection

Synopsis

Documentation

data Connection Source #

Constructors

Connection 

Fields

data ConnectionOpts #

Represents the parameters to connect to a broker or a cluster of brokers. See defaultConnectionOpts.

Constructors

ConnectionOpts 

Fields

defaultConnectionOpts :: ConnectionOpts #

Constructs default connection options with the following settings :

  • Broker: amqp://guest:guest@localhost:5672/%2F using the PLAIN SASL mechanism
  • max frame size: 131072
  • use the heartbeat delay suggested by the broker
  • no limit on the number of used channels

connect :: MonadIO m => ConnectionOpts -> m Connection Source #

Connect to the AMQP server.

conn <- connect (fromURI "amqp://guest:guest@localhost:5672")

withChannel :: Connection -> (Channel -> IO b) -> IO b Source #

Perform an action with a channel resource, and give it back at the end