ProtoFlux:Async For: Difference between revisions

From Resonite Wiki
Give info
AsyncCall not SyncResumption
Line 10: Line 10:
|Outputs=
|Outputs=
[
[
{"Name": "LoopStart", "Type":"SyncResumption"},
{"Name": "LoopStart", "Type":"AsyncCall"},
{"Name": "LoopIteration", "Type":"SyncResumption"},
{"Name": "LoopIteration", "Type":"AsyncCall"},
{"Name": "LoopEnd", "Type":"Continuation"},
{"Name": "LoopEnd", "Type":"Continuation"},
{"Name": "Iteration", "Type":"int"}
{"Name": "Iteration", "Type":"int"}
Line 21: Line 21:
== Inputs ==
== Inputs ==


=== * ([[Impulses#ASync|ASyncCall]]) ===
=== * ([[Impulses#ASync|IAsyncOperation]]) ===


Start the execution of this node.
Start the execution of this node.
Line 27: Line 27:
=== Count ([[Type:Int|int]]) ===
=== Count ([[Type:Int|int]]) ===


How many times to execute LoopIteration ([[Impulses#ASync|SyncResumption]])
How many times to execute LoopIteration ([[Impulses#ASync|AsyncCall]])


=== Reverse ([[Type:Bool|bool]]) ===
=== Reverse ([[Type:Bool|bool]]) ===
Line 35: Line 35:
== Outputs ==
== Outputs ==


=== LoopStart ([[Impulses#ASync|SyncResumption]]) ===
=== LoopStart ([[Impulses#ASync|AsyncCall]]) ===


Fires after * ([[Impulses#ASync|ASyncCall]]) is called and before any iterations or checks have been done.
Fires after * ([[Impulses#ASync|IAsyncOperation]]) is called and before any iterations or checks have been done.


=== LoopIteration ([[Impulses#ASync|SyncResumption]]) ===
=== LoopIteration ([[Impulses#ASync|AsyncCall]]) ===


Fires while the loop is running and after the previous LoopIteration ([[Impulses#ASync|SyncResumption]]) or LoopStart ([[Impulses#ASync|SyncResumption]]) has finished.
Fires while the loop is running and after the previous LoopIteration ([[Impulses#ASync|AsyncCall]]) or LoopStart ([[Impulses#ASync|AsyncCall]]) has finished.


=== LoopEnd ([[Impulses|Continuation]]) ===
=== LoopEnd ([[Impulses|Continuation]]) ===


Fires once the loop has finished all LoopIteration ([[Impulses#ASync|SyncResumption]]) in order.
Fires once the loop has finished all LoopIteration ([[Impulses#ASync|AsyncCall]]) in order.


=== Iteration ([[Type:Int|int]]) ===
=== Iteration ([[Type:Int|int]]) ===

Revision as of 22:45, 16 February 2024

Async For
*
LoopStart
Count
LoopIteration
Reverse
LoopEnd
Iteration
Async

ASync For is a protoflux node that will do a bunch of async tasks in order in an Async context, waiting for each task to be done before moving to the next one. This is useful if you want to do a bunch of GET String requests but you need to wait for the previous one to be done before doing the next, for a specified number of times. This does not behave the same as using a Start ASync Task on every For loop iteration or even before the For loop using a Start ASync Task.

Inputs

* (IAsyncOperation)

Start the execution of this node.

Count (int)

How many times to execute LoopIteration (AsyncCall)

Reverse (bool)

Whether to start at Count (int) and go backwards.

Outputs

LoopStart (AsyncCall)

Fires after * (IAsyncOperation) is called and before any iterations or checks have been done.

LoopIteration (AsyncCall)

Fires while the loop is running and after the previous LoopIteration (AsyncCall) or LoopStart (AsyncCall) has finished.

LoopEnd (Continuation)

Fires once the loop has finished all LoopIteration (AsyncCall) in order.

Iteration (int)

The current iteration of the loop.

Examples