Testing the $flow
Let's use separate rules, to demonstrate this feature:
$when::
flow.start
flow.step1
$when::
flow.start
flow.step2
$when::
flow.start
flow.step3
$when::
flow.start
flow.step4
Because there is a $flow
, the steps won't run in sequence as usual. Steps 2 and 3 will run in parallel - overall time should be around 3DUR, so less than 4DUR if the engine is not too busy...
$flow:: flow.start => ( flow.step1+( flow.step2|flow.step3 )+flow.step4 )
This rule matches each step and makes them all sleep:
$when::
/flow.step./.
ctx.sleep (duration=DUR)
. (dieselScope[="total"]
=(total + 1)
)
The reason these actually run in parallel is because ctx.sleep
is a truly asynchronous executor.
diesel.get("error") + p1+p2
You need to log in to post a comment!