Rule Machine Actions Execution

Easy question here.. Are rule machine Actions executed synchronously or asynchronously?

They're executed when triggered

That did not answer my question whatsoever.

Are rule machine Actions executed synchronously or asynchronously?

Synchronous or asynchronous to WHAT, though? Each other? Other RM rules? Something else?

The actions on a given rule execute in order so they can't be asynchronous to other actions in the same rule.

This answered my question, thanks Jason.

The one goofy exception to that may be "wait" rules. Maybe a few other exceptions, too. But in general they go in order.

The answer is that actions are executed in order when triggered. It is possible for multiple instances of a rule to be triggered, and to execute "at the same time". Depending on the rule this can be either a good thing or a disastrous thing (throwing errors and not working as expected). Delays in a rule open the door to this. Also, delayed actions will happen when they are scheduled to happen, so in that sense their execution is asynchronous, although deterministically scheduled.

It's worth noting that Wait does not really cause this, as a trigger event cancels any pending waits, and there can be only a single wait pending.


Thanks all!

Is this specific only to the "wait" or does it apply to any other aspects of delays etc for lack of a better way of expressing??

Only waits. If you trigger another instance of the rule and the rule doesn't cancel delayed actions, you will have multiple delays scheduled. The reason is that waits are conditional on a thing happening, not necessarily time. Delays happen regardless of anything else happening on the system at the time they are scheduled for.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.