An actor is a non-blocking concurrency primitive that communicates through messages. It occupies a thread only while processing a message, handles one message at a time, and queues messages sent concurrently. This serialized processing makes shared coordination less vulnerable to race conditions and deadlocks. section 7.3.4 section 7.6
Actors are useful when combining asynchronous results. In non-blocking Par.map2, an actor records whichever result arrives first and applies the combining function after both results arrive, avoiding direct low-level coordination between concurrent callbacks. section 7.3.4
A message echoer
An actor can receive strings and print each one: sending “hello,” “goodbye,” and a longer question produces the corresponding output. The ! operation sends messages asynchronously to the actor.
Combining two parallel results
A map2 actor receives either the left or right result, stores it when its partner is absent, and invokes the callback once both values are available.






