O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

You will notice a few peculiar things in this recipes:

  • The UserIntimation data is required to be an instance of Binary. This is required for serialization between the calling process and called process.
  • We first create a transport. In this case, we start the backend on a local server at port 10501.
  • We create a node where we would like to run the processes.
  • We use the Process monad to define what we want to do at the node.
  • The runProcess function takes the Process monad and converts it to IO action.
  • The receiveWait and match functions are used to wrap up the kind of messages we expect to run in Process.
  • We declare our expectation using either expect or expectTimeout. We use expectTimeout to showcase that if we do not get a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required