Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size of the mailbox #4

Closed
vallettea opened this issue Jan 9, 2017 · 2 comments
Closed

Size of the mailbox #4

vallettea opened this issue Jan 9, 2017 · 2 comments
Labels

Comments

@vallettea
Copy link

How can I know if an actor has message in its mailbox that should be processed ?

@weekens
Copy link
Contributor

weekens commented Jan 9, 2017

There are currently no actor mailboxes in Comedy.

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.

@weekens
Copy link
Contributor

weekens commented Jan 9, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants