The Rush Expression
Rush
The rush expression is used to run a block of two or more async expressions concurrently (simultaneously).
The rush expression is used to run a block of two or more async expressions concurrently (simultaneously).
When the fastest subexpression completes, any expression that follows the rush is evaluated, and any remaining subexpressions continue to evaluate.
| | set WinnerResult = rush: |
| --- | --- |
| | # All three async functions start at the same time |
| | AsyncFunctionLongTime() |
| | AsyncFunctionShortTime() # This will win and its result is used |
| | AsyncFunctionMediumTime() |
| | # Next expression is called after the fastest async function (AsyncFunctionShortTime()) completes. |
| | # All other subexpression tasks (AsyncFunctionLongTime(), AsyncFunctionMediumTime()) continue. |
| | NextExpression(WinnerResult) |
| | AsyncFunction4() |
| | # If any rush subexpression tasks are still running when AsyncFunction4 completes |
| | # then they are now canceled. |
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.