AsyncCall not SyncResumption |
refactor--make more concise and clear and I don't think we should have broken examples |
||
Line 17: | Line 17: | ||
|}} | |}} | ||
The '''Async For''' node is the analogue to the [[ProtoFlux:For|For]] node for an [[async context]]. | |||
== Inputs == | == Inputs == | ||
Line 23: | Line 23: | ||
=== * ([[Impulses#ASync|IAsyncOperation]]) === | === * ([[Impulses#ASync|IAsyncOperation]]) === | ||
Begin the for loop. | |||
=== Count ([[Type:Int|int]]) === | === Count ([[Type:Int|int]]) === | ||
How many times to | How many times to trigger <code>LoopIteration</code>. | ||
=== Reverse ([[Type:Bool|bool]]) === | === Reverse ([[Type:Bool|bool]]) === | ||
If <code>True</code>, the <code>Iteration</code> output will start at <code>Count - 1</code> and go down towards <code>0</code>. | |||
== Outputs == | == Outputs == | ||
Line 37: | Line 37: | ||
=== LoopStart ([[Impulses#ASync|AsyncCall]]) === | === LoopStart ([[Impulses#ASync|AsyncCall]]) === | ||
Fires after * | Fires after <code>*</code> is pulsed and before any iterations are done. Will be pulsed even if <code>Count < 1</code>. | ||
=== LoopIteration ([[Impulses#ASync|AsyncCall]]) === | === LoopIteration ([[Impulses#ASync|AsyncCall]]) === | ||
Fires | Fires for each iteration of the loop. This impulse is triggered <count>Count</code> amount of times and the next iteration will only be fired once the current iteration's [[context]] is finished. | ||
=== LoopEnd ([[Impulses|Continuation]]) === | === LoopEnd ([[Impulses|Continuation]]) === | ||
Fires | Fires after the final <code>LoopIteration</code> completes execution. | ||
=== Iteration ([[Type:Int|int]]) === | === Iteration ([[Type:Int|int]]) === | ||
For each <code>LoopIteration</code>, this output is set to be the index of the iteration for said iteration's context. By default, this will start at <code>0</code> and increment until <code>Count - 1</code> unless <code>Reverse</code> is <code>True</code>. | |||
== Examples == | == Examples == | ||
[[Category:ProtoFlux:Flow:Async]] | [[Category:ProtoFlux:Flow:Async]] |
Revision as of 21:23, 12 December 2024
Async For
Async
The Async For node is the analogue to the For node for an async context.
Inputs
* (IAsyncOperation)
Begin the for loop.
Count (int)
How many times to trigger LoopIteration
.
Reverse (bool)
If True
, the Iteration
output will start at Count - 1
and go down towards 0
.
Outputs
LoopStart (AsyncCall)
Fires after *
is pulsed and before any iterations are done. Will be pulsed even if Count < 1
.
LoopIteration (AsyncCall)
Fires for each iteration of the loop. This impulse is triggered <count>Count amount of times and the next iteration will only be fired once the current iteration's context is finished.
LoopEnd (Continuation)
Fires after the final LoopIteration
completes execution.
Iteration (int)
For each LoopIteration
, this output is set to be the index of the iteration for said iteration's context. By default, this will start at 0
and increment until Count - 1
unless Reverse
is True
.