13 Sharing mutable states with actors

In this chapter

  • Understanding the actor model
  • Using asynchronous messaging
  • Building an actor framework
  • Putting actors to work
  • Optimizing actor performance

In the previous chapters, you learned many techniques to help you write safer programs. Most of these techniques come from functional programming. One of these techniques consist in using immutable data to avoid state mutations. Programs without mutable states are safer, more reliable, and easier to design and scale.

You learned how mutable states can be handled in a functional way by passing the state along as an argument to functions. You saw several examples of this technique. You learned to generate streams of data by passing the state of a generator ...

Get The Joy of Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.