to make sure the events sent to an actor can be executed one by one (only process one at a time)
See: https://discord.com/channels/795785288994652170/800812250306183178/917025370186870794

I have just read a great article related to our discussion: Kotlin Concurrency with Actors, Jag Saund, Jun 14, 2018 (https://medium.com/@jagsaund/kotlin-concurrency-with-actors-34bd12531182), it discussed how to implement a Mailbox:
- "Signaling a Complete Operation with Actors"
Jag uses "Done message as a signal that tells us the Actor has processed all messages", I think the XState machine should have a similar state, for example, IDLE to indicate that it's not busy.
- "Distributing workload with Actors"
We can define a concurrency property in our Mailbox, and the Mailbox can spawn maximum concurrency actors to process the incoming events
- Mailbox as an EVENT proxy
The Mailbox should enqueue incoming (except its own actors) EVENT messages if there are no idle actors, and dequeue them and pass them to actors when there's any actor is idle.
On the other hand, all incoming EVENTS messages from their own actor should be respond to the original sender actor immediately.
Related issues
to make sure the events sent to an actor can be executed one by one (only process one at a time)
See: https://discord.com/channels/795785288994652170/800812250306183178/917025370186870794
I have just read a great article related to our discussion: Kotlin Concurrency with Actors, Jag Saund, Jun 14, 2018 (https://medium.com/@jagsaund/kotlin-concurrency-with-actors-34bd12531182), it discussed how to implement a Mailbox:
Jag uses "Done message as a signal that tells us the Actor has processed all messages", I think the XState machine should have a similar state, for example, IDLE to indicate that it's not busy.
We can define a concurrency property in our Mailbox, and the Mailbox can spawn maximum concurrency actors to process the incoming events
The Mailbox should enqueue incoming (except its own actors) EVENT messages if there are no idle actors, and dequeue them and pass them to actors when there's any actor is idle.
On the other hand, all incoming EVENTS messages from their own actor should be
respondto the original sender actor immediately.Related issues