Permalink
Browse files

remove the local subscriber AFTER the call to basic_cancel has finish…

…ed, not BEFORE
  • Loading branch information...
1 parent dd9bf1a commit a993c3dc74420621494a7bebacba0f8681a423df @hreinhardt hreinhardt committed Apr 4, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 Network/AMQP.hs
View
@@ -309,15 +309,14 @@ consumeMsgs chan queueName ack callback = do
-- | stops a consumer that was started with 'consumeMsgs'
cancelConsumer :: Channel -> ConsumerTag -> IO ()
cancelConsumer chan consumerTag = do
- --unregister the consumer
- modifyMVar_ (consumers chan) $ \c -> return $ M.delete consumerTag c
-
(SimpleMethod (Basic_cancel_ok consumerTag')) <- request chan $ (SimpleMethod (Basic_cancel
(ShortString consumerTag) -- consumer_tag
False -- nowait
))
-
- return ()
+
+ --unregister the consumer
+ modifyMVar_ (consumers chan) $ \c -> return $ M.delete consumerTag c
+
-- | @publishMsg chan exchangeName routingKey msg@ publishes @msg@ to the exchange with the provided @exchangeName@. The effect of @routingKey@ depends on the type of the exchange
--

0 comments on commit a993c3d

Please sign in to comment.