Messaging model

The basic premise of the Typed Actor Model is communication via method calls. The parameter values are the messages and these need to be immutable. The actor's state responds or reacts based on the method that is invoked onto it.

Sending messages

Once the actor reference is available, messages can be passed to an actor in two modes, as follows:

  • Fire and forget: This is a one-way method call model, where the caller of the method does not expect any reply. All methods with return types void or Unit belong to this category.
  • Send and receive: In this mode, the caller of the method expects a reply from the implementation class and will wait for that reply. In this mode, the method may be invoked asynchronously and a Future is returned representing ...

Get Akka Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.