Subscription Delay

Jun 10, 2009 at 11:35 AM

In section Subscribing to a publisher you say:

Please give it a moment to process the subscription before you send other messages to the worker which might generate notifications. Otherwise you might miss a notification.

This does not sound very usable. How long do I have to wait for the subscription to be processed?

Shouldn't the worker handle subscriptions with a higher priority? You could handle all subscription messages in sequence and before other messages.

Coordinator
Jun 14, 2009 at 7:42 AM

Christian:

The reason I wrote, you should give subscription message a little time to process is just that with parallel programming you don´t necessarily know which message gets processed first.

mypublisher.Post(new Subscribe<OnProgress>(progressPort));
mypublisher.Post(new DoWork(...));

Since workers expose their functions on several ports you can´t force the DoWork message to be handled after the Subscribe message. This can´t be avoided with message priorities. (Also there is no such thing as "all subscription messages". Subscriptions can be sent at any time. There´s no end to them.) The only help we could offer is to make processing of Subscribe/Unsubscribe exclusive. But still there is a slight chance for a race condition.

So all in all we say: Give publishers some time (200msec?) to process subscriptions. Mostly this shouldn´t be a problem but rather part of the overall solution.

-Ralf