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.
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
Unitbelong 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
Futureis returned representing ...