Usage Recommendations
You learned to create actors, send messages to them, and also how to coordinate between multiple instances. You used a stateless actor and also a stateful actor. You used both one-way communication and two-way communication. These options may seem a bit overwhelming. Let’s explore some recommendations for good use.
-
Rely more on stateless actors instead of stateful actors. Stateless actors don’t have identity, they can provide more concurrency, they’re easy to replicate, and they’re easy to restart and reuse. State may not be avoidable, but keep the use of stateful actors to a minimum—use them sparingly.
-
Keep the processing in the receive method really fast, especially if the receiving actor is stateful. Long-running tasks ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access