m fix types |
add info, example, how it works |
||
Line 17: | Line 17: | ||
|}} | |}} | ||
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 [[ProtoFlux:GET String|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 [[ProtoFlux:Start ASync Task|Start ASync Task]] on every [[ProtoFlux:For|For loop]] iteration or even before the for loop using a [[ProtoFlux:Start ASync Task|Start ASync Task]]. | |||
== Inputs == | |||
=== * === | |||
Start the execution of this node. | |||
=== Count ([[Type:Int|int]]) === | |||
How many times to execute LoopIteration ([[Impulses#ASync|SyncResumption]]) | |||
=== Reverse ([[Type:Bool|bool]]) === | |||
Whether to start at Count ([[Type:Int|int]]) and go backwards. | |||
== Outputs == | |||
=== LoopStart ([[Impulses#ASync|SyncResumption]]) === | |||
=== LoopIteration ([[Impulses#ASync|SyncResumption]]) === | |||
Fires while the loop is running and after the previous LoopIteration ([[Impulses#ASync|SyncResumption]]) or LoopStart ([[Impulses#ASync|SyncResumption]]) has finished. | |||
=== LoopEnd ([[Impulses|Continuation]]) === | |||
Fires once the loop has finished all LoopIteration ([[Impulses#ASync|SyncResumption]]) in order. | |||
=== Iteration ([[Type:Int|int]]) === | |||
The current iteration of the loop. | |||
== Examples == | |||
<gallery widths=480px heights=480px> | |||
File:Protoflux_example_ASync_For.webp|ASync For being used to do X cloud variable reads in order. | |||
File:Protoflux_example_ASync_For2.webp|ASync For being used to do X web requests in order. | |||
</gallery> | |||
[[Category:ProtoFlux:Flow:Async]] | [[Category:ProtoFlux:Flow:Async]] |
Revision as of 18:41, 16 February 2024
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
*
Start the execution of this node.
Count (int)
How many times to execute LoopIteration (SyncResumption)
Reverse (bool)
Whether to start at Count (int) and go backwards.
Outputs
LoopStart (SyncResumption)
LoopIteration (SyncResumption)
Fires while the loop is running and after the previous LoopIteration (SyncResumption) or LoopStart (SyncResumption) has finished.
LoopEnd (Continuation)
Fires once the loop has finished all LoopIteration (SyncResumption) in order.
Iteration (int)
The current iteration of the loop.
Examples
-
ASync For being used to do X cloud variable reads in order.
-
ASync For being used to do X web requests in order.