- Encapsulation with Actors—mutable state is only accessible from one actor, one thread. Actors are organized in hierarchies, and parents supervise children to achieve fault tolerance.
- We do so by extending the Actor class and implementing the receive method.
- We do so by calling the actorOf method on ActorSystem or ActorContext.
- Using the ! operator on an ActorRef—targetActor ! message.
- The ! operator implements a fire-and-forget type of message sending. It sends a message and returns immediately. Ask pattern involves sending a message using ? operator instead, which returns a Future[Any] which will complete once the target actor responds—val futureMessage: Future[Any] = targetActor ? message.
- The Pipe pattern instructs a Future to send a message to an actor upon completion of the Future's computation—future pipeTo targetActor.





















































