Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- connect :: MonadIO m => ConnectionOpts -> m Connection
- connect' :: MonadIO m => ConnectionOpts -> WorkerOpts -> m Connection
- disconnect :: MonadIO m => Connection -> m ()
- withChannel :: Connection -> (Channel -> IO b) -> IO b
- data Connection = Connection {}
- data WorkerOpts = WorkerOpts {
- exchange :: ExchangeName
- openTime :: Double
- maxChannels :: Int
- numStripes :: Maybe Int
- type ExchangeName = Text
- data ConnectionOpts = ConnectionOpts {
- coServers :: ![(String, PortNumber)]
- coVHost :: !Text
- coAuth :: ![SASLMechanism]
- coMaxFrameSize :: !(Maybe Word32)
- coHeartbeatDelay :: !(Maybe Word16)
- coMaxChannel :: !(Maybe Word16)
- coTLSSettings :: Maybe TLSSettings
- coName :: !(Maybe Text)
- defaultConnectionOpts :: ConnectionOpts
- fromURI :: String -> ConnectionOpts
Documentation
connect :: MonadIO m => ConnectionOpts -> m Connection Source #
Connect to the AMQP server using simple defaults
conn <- connect (fromURI "amqp://guest:guest@localhost:5672")
connect' :: MonadIO m => ConnectionOpts -> WorkerOpts -> m Connection Source #
disconnect :: MonadIO m => Connection -> m () Source #
withChannel :: Connection -> (Channel -> IO b) -> IO b Source #
Perform an action with a channel resource, and give it back at the end
data Connection Source #
Connection | |
|
data WorkerOpts Source #
WorkerOpts | |
|
Instances
Show WorkerOpts Source # | |
Defined in Network.AMQP.Worker.Connection showsPrec :: Int -> WorkerOpts -> ShowS # show :: WorkerOpts -> String # showList :: [WorkerOpts] -> ShowS # | |
Eq WorkerOpts Source # | |
Defined in Network.AMQP.Worker.Connection (==) :: WorkerOpts -> WorkerOpts -> Bool # (/=) :: WorkerOpts -> WorkerOpts -> Bool # |
type ExchangeName = Text Source #
data ConnectionOpts #
Represents the parameters to connect to a broker or a cluster of brokers.
See defaultConnectionOpts
.
ConnectionOpts | |
|
defaultConnectionOpts :: ConnectionOpts #
Constructs default connection options with the following settings :
- Broker:
amqp://guest:guest@localhost:5672/%2F
using thePLAIN
SASL mechanism - max frame size:
131072
- use the heartbeat delay suggested by the broker
- no limit on the number of used channels
fromURI :: String -> ConnectionOpts #
Parses amqp standard URI of the form amqp://user:password
host:port/vhost and returns a
ConnectionOpts for use with
openConnection''
| Any of these fields may be empty and will be replaced with defaults from
amqp:/guest:guest@localhost:5672@