ProtoFlux:Async While: Difference between revisions

From Resonite Wiki
added info, no longer stub
m fix caution box
Line 17: Line 17:
ASync While is a ProtoFlux node that will wait for every ASync node fired by LoopStart ([[Impulses#ASync|SyncResumption]]) and LoopIteration ([[Impulses#ASync|SyncResumption]]) to finish their execution before firing the next impulse. 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:While|While loop]] iteration or even before the [[ProtoFlux:While|While loop]] using a [[ProtoFlux:Start ASync Task|Start ASync Task]].
ASync While is a ProtoFlux node that will wait for every ASync node fired by LoopStart ([[Impulses#ASync|SyncResumption]]) and LoopIteration ([[Impulses#ASync|SyncResumption]]) to finish their execution before firing the next impulse. 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:While|While loop]] iteration or even before the [[ProtoFlux:While|While loop]] using a [[ProtoFlux:Start ASync Task|Start ASync Task]].


{{Template:Note|Caution should be used when using this node. giving it no nodes to fire on LoopIteration ([[Impulses#ASync|SyncResumption]]) or plugging a value that will never be true into Condition ([[Type:Bool|bool]]) may result in a crash or infinite execution!|danger}}
{{Template:Note|Caution should be used when using this node. giving it no nodes to fire on LoopIteration ([[Impulses#ASync|SyncResumption]]) or plugging a value that will never be false into Condition ([[Type:Bool|bool]]) may result in a crash or infinite execution!|danger}}


== Inputs ==
== Inputs ==

Revision as of 22:17, 16 February 2024

Async While
*
LoopStart
Condition
LoopIteration
LoopEnd
Async

ASync While is a ProtoFlux node that will wait for every ASync node fired by LoopStart (SyncResumption) and LoopIteration (SyncResumption) to finish their execution before firing the next impulse. 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 While loop iteration or even before the While loop using a Start ASync Task.

Caution should be used when using this node. giving it no nodes to fire on LoopIteration (SyncResumption) or plugging a value that will never be false into Condition (bool) may result in a crash or infinite execution!

Inputs

* (AsyncCall)

Call this to start execution of the loop.

Condition (bool)

The execution will check this after every finished LoopIteration (SyncResumption) and will fire the next LoopIteration (SyncResumption) if the provided Condition is true.

Outputs

LoopStart (SyncResumption)

Fires once * (AsyncCall) is called before even checking if this node can execute.

LoopIteration (SyncResumption)

Fires once the previous LoopIteration (SyncResumption) has fired and finished or LoopStart (SyncResumption) has fired and finished.

LoopEnd (Continuation)

Fires after a LoopIteration (SyncResumption) has fired and Condition (bool) is false.

Example