Agents

Akka provides another construct called agents. As part of the transactors we saw the usage of Refs and how they support and coordinate synchronous change of multiple locations in a transaction. On the other hand, agents provide independent, asynchronous change of individual locations. Agents provide shared access to the immutable state.

Akka agents are modeled on the Clojure agents. Clojure agents are reactive, not autonomous, that is, there is no imperative message loop and no blocking received. Clojure agents are native threads that are managed in thread pools for performance. Agents' primary plus point is that they run on a different thread. One can get the value of the agent without any block calls, and any state changes are effected ...

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.