Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping a time-delayed message

Solved!
Go to solution

How close to the "wait" time can you be and still be guaranteed the "Stop all copies" will be honored?

Example:  Time delayed message set with 1 second wait. After 800ms elapses the notifer is sent with Stop all further messages.  Will it stop, or will one message still be sent?

Thanks,

Kevin

0 Kudos
Message 1 of 26
(10,235 Views)
Solution
Accepted by topic author kwkengineer

Notifiers are nondeterministic, so there really is no guarantee.  We can discuss the probability that a notification will be received within a certain time, but that's about it.

0 Kudos
Message 2 of 26
(4,309 Views)

Even when running on a RT target?

0 Kudos
Message 3 of 26
(4,309 Views)

Even on an RT target.  Notifiers are nondeterministic.  As are queues, btw, which means that AF in general is nondeterministic.  This isn't a particular problem of AF - systems built from queued message handlers have the same challenges.

0 Kudos
Message 4 of 26
(4,309 Views)

Any sort of messaging between two loops where one of the loops is not a Timed Loop is non-deterministic at least on the end that isn't inside a Timed Loop. It might also be non-deterministic on the end that is inside the Timed Loop depending upon the nature of the communication.

0 Kudos
Message 5 of 26
(4,309 Views)

got it.  Makes sense now that you've forced me to think about it.

0 Kudos
Message 6 of 26
(4,309 Views)

kwkengineer wrote:

Example:  Time delayed message set with 1 second wait. After 800ms elapses the notifer is sent with Stop all further messages.  Will it stop, or will one message still be sent?

If this uncertainty is an issue, then you might be better to develope a full-actor version of the "Time-delayed Send message" functionality (why isn't this an actor already, BTW?).  Then one can do a Reply message or use the Last Ack to determine that it is now certain that no more messages will be sent.

0 Kudos
Message 7 of 26
(4,309 Views)

drjdpowell wrote:

(why isn't this an actor already, BTW?)

Because no one suggested it when I first created it. It was seen as just a utility function --- we hadn't yet gotten the idea of all async processes as actors. Changing the API at this point would be a breaking change. I've thought about deprecating it for something new, but it also has seen so little use that I haven't made it a priority.

0 Kudos
Message 8 of 26
(4,309 Views)

Well I certainly hope you arn't gonna remove it since it's an ideal tool for me.

I use the time-delayed message to sample a measurement device every 2 seconds.

0 Kudos
Message 9 of 26
(4,309 Views)

drjdpowell wrote:

kwkengineer wrote:

Example:  Time delayed message set with 1 second wait. After 800ms elapses the notifer is sent with Stop all further messages.  Will it stop, or will one message still be sent?

If this uncertainty is an issue, ...

It was an issue, but no more.  The problem was more with my implementation of the two messages in question which made the timing of the Stop critical.  I was able to tweak the design slightly and now all is well.

0 Kudos
Message 10 of 26
(4,309 Views)