If you are familiar with Erlang or Akka, you may already know what actors are and how to use them. But in any case, we'll refresh our knowledge about the actors model in this section.
Actor concurrency in microservices
Understanding actors
We already became familiar with actors in Chapter 10, Background Tasks and Thread Pools in Microservices, but let's talk about using actors for microservices.
An actor is a model for doing concurrent computations. We should know the following models:
- Threads: In this model, every task works in a separate thread
- Fibers or green threads: In this model, every task has work scheduled by a special runtime
- Asynchronous code: In this model, every task is run by a...