![]() - Add support for running examples easily with `stack`. - Fix calls made to `threadDelay` that were using milliseconds intead of nanoseconds. - amqp-0.9 added a Bool parameter to the `qos` that was causing worker.hs to not compile. - Removed almost all use of String in favor of Lazy ByteString. |
||
---|---|---|
.. | ||
emitLog.hs | ||
emitLogDirect.hs | ||
emitLogTopic.hs | ||
newTask.hs | ||
README.md | ||
receive.hs | ||
receiveLogs.hs | ||
receiveLogsDirect.hs | ||
receiveLogsTopic.hs | ||
send.hs | ||
worker.hs |
Haskell code for RabbitMQ tutorials
Here you can find Haskell code examples from RabbitMQ tutorials.
Requirements
To run this code you need Network.AMQP.
Running the examples with stack
- Install
stack
. - Run the scripts via
stack FILE ARGS
instead ofrunhaskell FILE ARGS
. (This installsghc
, plusamqp
and other required packages for you.)
Code
Code examples are executed via runhaskell
:
runhaskell send.hs
runhaskell receive.hs
runhaskell newTask.hs hello world
runhaskell worker.hs
Tutorial three: Publish/Subscribe
runhaskell receiveLogs.hs
runhaskell emitLog.hs hello world
runhaskell receiveLogsDirect.hs info warn
runhaskell emitLogDirect.hs warn "a warning"
runhaskell receiveLogsTopic.hs info warn
runhaskell emitLogTopic.hs warn "a warning"
TBD
To learn more, see Network.AMQP.