amqp 0.1.2 → 0.1.3
raw patch · 2 files changed
+6/−6 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Network.AMQP: declareQueue :: Channel -> QueueOpts -> IO ()
+ Network.AMQP: declareQueue :: Channel -> QueueOpts -> IO String
Files
- Network/AMQP.hs +5/−5
- amqp.cabal +1/−1
Network/AMQP.hs view
@@ -202,7 +202,7 @@ data QueueOpts = QueueOpts { --must be set- queueName :: String, -- ^ (must be set); the name of the queue+ queueName :: String, -- ^ (default \"\"); the name of the queue; if left empty, the server will generate a new name and return it from the 'declareQueue' method --optional queuePassive :: Bool, -- ^ (default 'False'); If set, the server will not create the queue. The client can use this to check whether a queue exists without modifying the server state. @@ -215,10 +215,10 @@ newQueue :: QueueOpts newQueue = QueueOpts "" False True False False --- | creates a new queue on the AMQP server; can be used like this: @declareQueue channel newQueue {queueName = \"myQueue\"}@-declareQueue :: Channel -> QueueOpts -> IO () +-- | creates a new queue on the AMQP server; can be used like this: @declareQueue channel newQueue {queueName = \"myQueue\"}@. Returns the name of the new queue (if you don't specify a queueName the server will autogenerate one).+declareQueue :: Channel -> QueueOpts -> IO String declareQueue chan queue = do- (SimpleMethod (Queue_declare_ok (ShortString queueName) _ _)) <- request chan $ (SimpleMethod (Queue_declare + (SimpleMethod (Queue_declare_ok (ShortString qName) _ _)) <- request chan $ (SimpleMethod (Queue_declare 1 -- ticket (ShortString $ queueName queue) (queuePassive queue) @@ -228,7 +228,7 @@ False -- no-wait; true means no answer from server (FieldTable (M.fromList [])))) - return () + return qName -- | @bindQueue chan queueName exchangeName routingKey@ binds the queue to the exchange using the provided routing key bindQueue :: Channel -> String -> String -> String -> IO ()
amqp.cabal view
@@ -1,5 +1,5 @@ Name: amqp -Version: 0.1.2 +Version: 0.1.3 Synopsis: Client library for AMQP servers (currently only RabbitMQ) Description: Client library for AMQP servers (currently only RabbitMQ) License: BSD3