Working with Cloud Haskell
So far, we have seen multi-threaded concurrency. In this recipe, we will look at distributed concurrency, where the concurrency can be achieved through multiple processes either on the same machine or a cluster of machines. In this recipe, we will create a local node and communicate with it using tcp transport.
Getting ready
We will use cloud-haskell
libraries for this.
How to do it...
- Create a new project called
working-with-cloud-haskell
with thesimple
stack template:
stack new working-with-cloud-haskell simple
- Add a dependency on the
distributed-process
library in thebuild-depends
sub-section ofexecutable
section. Also add support libraries and the-threaded
option toghc-options
:
executable working-with-cloud-haskell hs-source-dirs: src main-is: Main.hs ghc-options: -threaded default-language: Haskell2010 build-depends: base >= 4.7 && < 5 ...