amqp 0.1.3 → 0.2
raw patch · 2 files changed
+9/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Network.AMQP: declareQueue :: Channel -> QueueOpts -> IO String
+ Network.AMQP: declareQueue :: Channel -> QueueOpts -> IO (String, Int, Int)
Files
- Network/AMQP.hs +8/−4
- amqp.cabal +1/−1
Network/AMQP.hs view
@@ -215,10 +215,14 @@ 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\"}@. Returns the name of the new queue (if you don't specify a queueName the server will autogenerate one).-declareQueue :: Channel -> QueueOpts -> IO String+-- | creates a new queue on the AMQP server; can be used like this: @declareQueue channel newQueue {queueName = \"myQueue\"}@. +--+-- Returns a tuple @(queueName, messageCount, consumerCount)@. +-- @queueName@ is the name of the new queue (if you don't specify a queueName the server will autogenerate one). +-- @messageCount@ is the number of messages in the queue, which will be zero for newly-created queues. @consumerCount@ is the number of active consumers for the queue.+declareQueue :: Channel -> QueueOpts -> IO (String, Int, Int) declareQueue chan queue = do- (SimpleMethod (Queue_declare_ok (ShortString qName) _ _)) <- request chan $ (SimpleMethod (Queue_declare + (SimpleMethod (Queue_declare_ok (ShortString qName) messageCount consumerCount)) <- request chan $ (SimpleMethod (Queue_declare 1 -- ticket (ShortString $ queueName queue) (queuePassive queue) @@ -228,7 +232,7 @@ False -- no-wait; true means no answer from server (FieldTable (M.fromList [])))) - return qName+ return (qName, fromIntegral messageCount, fromIntegral consumerCount) -- | @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.3 +Version: 0.2 Synopsis: Client library for AMQP servers (currently only RabbitMQ) Description: Client library for AMQP servers (currently only RabbitMQ) License: BSD3