rabbitmq-tutorials/haskell
Erik Stevenson 3b6a5e908c Update haskell examples.
- 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.
2016-12-16 13:39:18 -05:00
..
emitLog.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
emitLogDirect.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
emitLogTopic.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
newTask.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
README.md Update haskell examples. 2016-12-16 13:39:18 -05:00
receive.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
receiveLogs.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
receiveLogsDirect.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
receiveLogsTopic.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
send.hs Update haskell examples. 2016-12-16 13:39:18 -05:00
worker.hs Update haskell examples. 2016-12-16 13:39:18 -05:00

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

  1. Install stack.
  2. Run the scripts via stack FILE ARGS instead of runhaskell FILE ARGS. (This installs ghc, plus amqp and other required packages for you.)

Code

Code examples are executed via runhaskell:

Tutorial one: "Hello World!":

runhaskell send.hs
runhaskell receive.hs

Tutorial two: Work Queues:

runhaskell newTask.hs hello world
runhaskell worker.hs

Tutorial three: Publish/Subscribe

runhaskell receiveLogs.hs
runhaskell emitLog.hs hello world

Tutorial four: Routing

runhaskell receiveLogsDirect.hs info warn
runhaskell emitLogDirect.hs warn "a warning"

Tutorial five: Topics

runhaskell receiveLogsTopic.hs info warn
runhaskell emitLogTopic.hs warn "a warning"

Tutorial six: RPC

TBD

To learn more, see Network.AMQP.