Using Cloud Haskell to start master and slave nodes
In this recipe, we will use simplelocalnet to create master and slave nodes. We will start slave nodes and a master node, and use the master node learn about the slave nodes.
How to do it...
- Create a new project called
master-slavewith thesimplestack template:
stack new master-slave simple
- Add a dependency on the
distributed-processanddistributed-process-localnetlibraries in thebuild-dependssub-section of theexecutablesection:
executable master-slave
hs-source-dirs: src
main-is: Main.hs
default-language: Haskell2010
build-depends: base >= 4.7 && < 5
, distributed-process
, distributed-process-simplelocalnet- Note that you might have to add the dependent library specifically to the
extra-depssection, as these libraries are not part of stackage LTS at the time of writing this recipe...