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

Network.AMQP.Worker.Queue

Synopsis

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)

data Queue msg Source #

Constructors

Queue (Key Binding msg) QueueName 

Instances

Instances details
Show (Queue msg) Source # 
Instance details

Defined in Network.AMQP.Worker.Queue

Methods

showsPrec :: Int -> Queue msg -> ShowS #

show :: Queue msg -> String #

showList :: [Queue msg] -> ShowS #

Eq (Queue msg) Source # 
Instance details

Defined in Network.AMQP.Worker.Queue

Methods

(==) :: Queue msg -> Queue msg -> Bool #

(/=) :: Queue msg -> Queue msg -> Bool #

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