You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In in-memory case, all messaging boils down to method invocation, in which case the asynchronous message queue is built into the language and requires no special effort from us.
In forked case, the message is immediately sent to the pipe and, again, NodeJS handles message queues and asynchronous IO itself.
For the moment, there is only one case when we would need the mailbox: it is the case when a just-initialized child starts sending messages to a not-yet-initialized parent. But for the moment Comedy is implemented in a way that these messages are simply ignored and parent actor starts receiving messages only after it is completely initialized.
Actually, when you're using Actor.sendAndReceive() method, an actor internally keeps track of the messages, that it didn't receive a response for yet. It's not exactly a mailbox. We can call it "receive list". There is no public method for the moment, that returns a size of this receive list, but surely it can be implemented and may be quite useful.
How can I know if an actor has message in its mailbox that should be processed ?
The text was updated successfully, but these errors were encountered: