Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
direct :: Key Routing msg -> Queue msg Source #
Declare a direct queue, which will receive messages published with the exact same routing key
newUsers :: Queue User newUsers = Worker.direct (key "users" & word "new")
topic :: KeySegment a => Key a msg -> QueueName -> Queue msg Source #
Declare a topic queue, which will receive messages that match using wildcards
anyUsers :: Queue User anyUsers = Worker.topic "anyUsers" (key "users" & star)
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.
let queue = Worker.direct (key "users" & word "new") :: Queue User conn <- Worker.connect (fromURI "amqp://guest:guest@localhost:5672") Worker.bindQueue conn queue