AsyncModule: first in - first out behaviour for prioritized messages

5 views
Skip to first unread message

Xaver Birrer

unread,
Apr 19, 2012, 7:56:49 AM4/19/12
to bbvcommon
Hey all

The AsyncModule is great!

Although, one thing I like to change is the queuing behaviour of
prioritzed messages - its a change request, not a bug report ;-).

As it is now, prioritzed messages are added at the front of the queue
whenever the are enqued which inverts the execution order of such
messages (fifo turns to lifo).
The current behaviour is perfect if all prio messages are independant,
but if some prio messages are dependant the enqueing order must be
maintained.

What do you think about it? Could my change request make it into the
component?

Example:

Provider enqueues:
LowPrio A
LowPrio B
HighPrio C
HighPrio D

Now: Consumer reads
HighPrio D (since D was last added)
HighPrio C
LowPrio A
LowPrio B

Wish: Consumer reads
HighPrio C (since C was first added)
HighPrio D
LowPrio A
LowPrio B



Urs Enzler

unread,
Apr 19, 2012, 1:17:06 PM4/19/12
to bbvc...@googlegroups.com
Hi Xavi

It's not possible to get this behaviour with the current version out of the box. It could however be possible with an extension.
The extension would have to keep track of whether the message was queued normally or as priority. And if reordering is necessary, the extension should clear the queue and re-add the messages according to the wanted ordering. 
This solution could by tricky regarding some multi-threading edge cases, though.

Once, the .Net 4.5 version is out, there will be a rewrite of the AsyncModule and we will try to incorporate that then.

Cheers
Urs

Xaver Birrer

unread,
Apr 23, 2012, 9:30:07 AM4/23/12
to bbvcommon
Thanks a lot for your response Urs!

I guessed there is a "extension based way" with all these nice
extension features :-)

Best regards
Xavi
Reply all
Reply to author
Forward
0 new messages