If I have only one Akka actor that I create at the start of my program, is every message I tell
that actor processed sequentially, on a single thread? So if I have multiple threads tell
ing that actor to do different tasks, is it essentially the same thing as having multiple threads queue up tasks on Java's Executor.newSingleThreadExecutor
?
An actor processes messages sequentially and (in Akka, at least) presents a single-threaded illusion (that is to say that under the hood, the dispatcher may execute the actor's logic on different threads from message to message, but from the actor's perspective there's only one thread).
If there's only one actor, the message processing is effectively the same thing as queueing up tasks in a single threaded executor (with the potential extra benefit that each executed task can affect the execution of subsequent tasks by changing how the actor responds to a message).
Accordingly, an actor all by itself is not that useful an abstraction; put a lot of actors into a system where they can collaborate and you have something that is surprisingly useful and powerful.