Skip to content

Are messages to self, delivered *before* other messages ? #160

Answered by slawlor
nsengupta asked this question in Q&A
Discussion options

You must be logged in to vote

So if you want to send an actual message to the actor it'll go through the same shared message queue that all messages use. Meaning that first come, first served which is true to Erlang OTP. This means that if there's already messages in the queue (from anyone), any new incoming messages will end up at the back of the queue, including from self. There's no priority queueing or anything like that.

That being said, what you described can be modelled by an actor in an actor. The inner actor's message queue is gated by the parent actor which could interleave messages to change the inner's state. So you could essentially control the inner actor's message queue, threading internal messages alon…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by slawlor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants