Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type QueueName = Text
- type QueuePrefix = Text
- data Queue msg = Queue (Key Bind 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
type QueuePrefix = Text Source #
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 will load balance if operating on the same queue, or on queues with the same name
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