Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Messaging

Every actor has a mailbox, where any other messages can be sent. Akka guarantees that the messages are handled by the actor one at a time, and no concurrent handling happens. In fact, the actor model provides a guarantee that no more than one thread accesses the internal state of an actor at a time. However, keep in mind that it is up to the programmer to follow the actor model precisely. It is easy to break the model by spawning extra threads (e.g. with a Future) in an actor, thus breaking the single-threaded access guarantee.

This restriction is essential to enforce in the presence of other convenient concurrency libraries, such as Future. Akka works hand-in-hand with Scala Future. It is important to remember that futures start ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content