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-slave
with thesimple
stack template:
stack new master-slave simple
- Add a dependency on the
distributed-process
anddistributed-process-localnet
libraries in thebuild-depends
sub-section of theexecutable
section:
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-deps
section, as these libraries are not part of stackage LTS at the time of writing this recipe...