Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Feature Request] message priority #3

Open
tsouza opened this Issue · 0 comments

1 participant

@tsouza

Hello there,

Using a binary heap (http://eloquentjavascript.net/appendix2.html) it is possible to send prioritized messages. This helps implementing QoS (i.e. when certain actors are CPU-bound).

An actor could contain both type of inboxes (binary heap and array), so messages would go to one or another depending if there is an assigned priority or not. The actor would first process all messages from the heap inbox before jumping to array inbox. Also, replying to a prioritized message should inherit the priority (in case the recipient is also an actor).

Sending a message with priority could be as simple as:

// higher priority
actor.withPriority(0).tell("hello");

// lower priority
actor.withPriority(1).tell("hello");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.