-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add UnboundedStablePriorityMailbox #2652
Comments
I need a mailbox that allows for prioritization of its contents and preserves ordering for messages of equal priority. I am aware that, in akka .NET, I need to implement "UnboundedPriorityMailbox" to have a mailbox that allows for prioritization of its contents; however this latter would not preserve a FIFO ordering for messages of equal priority. Am I missing something? Is there any workaround? |
@yahyanajar Have you read the docs regarding the UnboundedPriority Mailbox ? http://getakka.net/docs/working-with-actors/Mailbox If you implement a PriorityGenerator you should have sufficient control to achieve what you want. |
@Danthar the key bit is this:
Currently not implemented; will need a different priority queue implementation than what we have at the moment. |
Thats whats in the docs. Seems to me thats exactly whats requested ? If im misunderstanding, its always a possibility to implement your own prioritymailbox @yahyanajar . |
Yes it is in the docs but that's not how it works, since it is implemented
as a simple priority heap that is not stable. Would you like us to provide
a simple code that shows the t doesn't work ?
Le ven. 19 mai 2017 à 12:31, Arjen Smits <notifications@github.com> a
écrit :
… Messages ordered by the same number will remain in delivery order.
Thats whats in the docs. Seems to me thats exactly whats requested ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2652 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFyNcHdgnMgKK4t_UqtYvGvljEaI3Qx-ks5r7W9xgaJpZM4NVTdd>
.
|
Hi, there goes a sample code illustrating the obtained/expected message handling order, and also showing that it comes from the implementation of https://gist.github.com/maurelio1234/724df2a39058b12730fc63d49b681a32 |
The current documentation/comment on UnboundedPriorityMailbox should probably be updated. akka.io's documentation states |
I'm looking at ListPriorityQueue and one thing I'm not following is if it is sorting on insert (Enqueue), why is it sorting on Dequeue? I'm also not following the logic (in Dequeue) of
Why can't we just do: (assuming there is something to dequeue)
Edit: Well, shoot...I guess I'm under the assumption that the priority calculation is static. If (for example) age of the message was a consideration, then deque-time ordering would be important. Moving the last item to the front still seems odd. |
Maybe I'm wrong, but it's looks like a heap implementation, so your step 4 is a little bit more complicated than "sorting" elements. The 'solution' would be either using the order of arrival of messages along with their priority to compare element with the same priority, or something like the StablePriorityQueue they have in scala Akka. |
Yeah, its using a heap implementation so its not really a true sort. akka.io says that ordering is indeterminate (in their implementation) so the comment here should probably state something similar? EDIT: I pushed it here. It's pretty simplistic but there it is. |
…priority. Messages with the same priority will be send using the same order as they appear. akkadotnet#2652 is the related issue.
* Added an UnboundStablePriorityMailbox, sending messages according to priority. Messages with the same priority will be send using the same order as they appear. #2652 is the related issue. * added PropertyTest for StableListPriorityQueue * forgot to add spec * verified that the UnboundedStablePriorityMailbox can be loaded and used * validate4d that UnboundedStablePriorityMailbox supports stashing * added API approval for core
closed via #3536 |
* Added an UnboundStablePriorityMailbox, sending messages according to priority. Messages with the same priority will be send using the same order as they appear. akkadotnet#2652 is the related issue. * added PropertyTest for StableListPriorityQueue * forgot to add spec * verified that the UnboundedStablePriorityMailbox can be loaded and used * validate4d that UnboundedStablePriorityMailbox supports stashing * added API approval for core
"UnboundedStablePriorityMailbox": an unbounded mailbox that allows for prioritization of its contents and preserves ordering for messages of equal priority
The text was updated successfully, but these errors were encountered: