|:: MonadBaseControl IO m|
Specifies the name of the queue to consume from.
|-> ((Message, Envelope) -> m ())|
|-> m ConsumerTag|
consumeMsgs chan queueName ack callback subscribes to the given queue and returns a consumerTag. For any incoming message, the callback will be run. If
ack == you will have to acknowledge all incoming messages (see
NOTE: The callback will be run on the same thread as the channel thread (every channel spawns its own thread to listen for incoming data) so DO NOT perform any request on
chan inside the callback (however, you CAN perform requests on other open channels inside the callback, though I wouldn't recommend it).
Functions that can safely be called on
recoverMsgs. If you want to perform anything more complex, it's a good idea to wrap it inside
In addition, while the callback function
has access to the captured state, all its side-effects in m are discarded.
Envelope) -> m ())