Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type QueueName = Text
- newtype QueuePrefix = QueuePrefix Text
- data Queue msg = Queue (Key Binding msg) QueueName
- queue :: MonadIO m => Connection -> QueuePrefix -> Key a msg -> m (Queue msg)
- queueNamed :: MonadIO m => Connection -> QueueName -> Key a msg -> m (Queue msg)
- queueName :: QueuePrefix -> Key a msg -> QueueName
- bindQueue :: MonadIO m => Connection -> Queue msg -> m ()
Documentation
newtype QueuePrefix Source #
Instances
IsString QueuePrefix Source # | |
Defined in Network.AMQP.Worker.Queue fromString :: String -> QueuePrefix # | |
Show QueuePrefix Source # | |
Defined in Network.AMQP.Worker.Queue showsPrec :: Int -> QueuePrefix -> ShowS # show :: QueuePrefix -> String # showList :: [QueuePrefix] -> ShowS # | |
Default QueuePrefix Source # | |
Defined in Network.AMQP.Worker.Queue def :: QueuePrefix # | |
Eq QueuePrefix Source # | |
Defined in Network.AMQP.Worker.Queue (==) :: QueuePrefix -> QueuePrefix -> Bool # (/=) :: QueuePrefix -> QueuePrefix -> Bool # |
A queue is an inbox for messages to be delivered
queue :: MonadIO m => Connection -> QueuePrefix -> Key a msg -> m (Queue msg) Source #
queueNamed :: MonadIO m => Connection -> QueueName -> Key a msg -> m (Queue msg) Source #
Create a queue to receive messages matching the binding key. Each queue with a unique name will be delivered a separate copy of the messsage. Workers operating on the same queue, or on queues with the same name will load balance
queueName :: QueuePrefix -> Key a msg -> QueueName Source #
Name a queue with a prefix and the binding key name. Useful for seeing at a glance which queues are receiving which messages
-- "main messages.new" queueName "main" (key "messages" & word "new")
bindQueue :: MonadIO m => Connection -> Queue msg -> m () Source #
Queues must be bound before you publish messages to them, or the messages will not be saved.
Use queue
or queueNamed
instead