Priority queue #37
Replies: 1 comment 3 replies
-
It seems strange to handle parsing with asynchronous calls, since parsing is synchronous. Does it really need to be connected up by asynchronous calls? So one question is whether the architecture is mapped to the actor model in a natural way. But I will suppose there is a good reason why it has to be done this way. There is no support for queue-jumping or anything like that in Stakker, at least not on the main queue. If you submit something to the lazy queue, that will run after everything else has been completed. So if you submit all new messages via the lazy queue, then if you resubmit the message via the main queue, then that will be run before the next message is processed from the lazy queue. So that should get you what you want. The intention is that you limit data flow into the actor system, i.e. don't submit something to the actor system until you're sure you want to pay the cost of processing it. The lazy queue is intended as the mechanism to limit flow of data into the system (e.g. typically by fetching more data lazily). Stuff on the timer queue will get processed after the current calls on the main queue are cleared. Timers set before 'now' get processed at the first opportunity, i.e. as if it is set for 'now'. It doesn't really help in this situation. |
Beta Was this translation helpful? Give feedback.
-
I'm currently experimentally trying to port code from CAF/C++ to Stakker. The code basically deals with package parsing, where there are header and data packages. The original code sometimes had to re-queue a message, but with a higher priority than the other messages.
To implement the same thing in Stakker, it seems I would need to use the lazy queue by default in order to do something like this. Is this correct or can I somehow send messages with a higher priority?
Edit: I think using the
at
macro withInstant::now()
might work, but I have no idea what happens if the desired instant is in the past already.Beta Was this translation helpful? Give feedback.
All reactions