chapter eight

8 Reactive applications

 

This chapter covers

  • What is actor model and how to design it
  • Learning the MVar request-response pattern
  • Creating a stateful concurrent simulator
  • Learning more on reactive architectures

Looking back at the work we have done together we can be proud of ourselves. We have learned a lot, we discussed many interesting ideas in software design, and we tackled a variety of engineering problems. The solutions and approaches we’ve explored are all inhabiting my methodology Functional Declarative Design - a methodology for building applications from end to end in functional languages. This chapter finishes the proof that the methodology really works. We’re going to finally assemble many parts of our Andromeda software and produce the final result of it - the simulator. I promised we’ll do it, and here we are.

I’m sure this is a good time to talk about reactive applications. Our simulator will be this: an application having different individual parts able to react to something. “Individual” here means those parts will have their own threads, and they will act as small separate applications. In other words, in this chapter, we’ll slightly touch on a specific reactive model of interactions, namely, the actor model.

8.1 Actor model

8.1.1 Simulation of actors

8.1.2 The architecture of the simulator

8.1.3 The MVar Request-Response pattern

8.2 Implementing the simulator

8.2.1 Simulator as an actor

8.2.2 Stateful simulation model

8.3 Summary