Practical Web Development with Haskell by Ecky Putrady

Practical Web Development with Haskell by Ecky Putrady

Author:Ecky Putrady
Language: eng
Format: epub
ISBN: 9781484237397
Publisher: Apress


The parameters are similar to getMsg. The fourth parameter is the callback that will be invoked when we receive a message. The callback is simply an IO action that accepts (Message, Envelope) as its input. The return value of this function is a ConsumerTag, which actually is just a synonym for Text. ConsumerTag is a string that is generated by RabbitMQ that identifies a consumer uniquely.

Please be aware that the callback is executed on the same thread as the channel thread. Every channel spawns its own thread to listen to incoming data. So it’s best to immediately spawn a new thread for processing the message.

For acknowledging and rejecting the message, the functions to use are:ackEnv :: Envelope -> IO ()

rejectEnv :: Envelope -> Bool -> IO ()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.