ProtoFlux:ASync While

From Resonite Wiki
(Redirected from ASync While (ProtoFlux))
Async While
*
LoopStart
Condition
LoopIteration
LoopEnd
Async

ASync While is a ProtoFlux node that will wait for every ASync node fired by LoopStart (AsyncCall) and LoopIteration (AsyncCall) 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 (AsyncCall) or plugging a value that will never be false into Condition (bool) may result in a crash or infinite execution!

Inputs

* (IAsyncOperation)

Call this to start execution of the loop.

Condition (bool)

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

Outputs

LoopStart (AsyncCall)

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

LoopIteration (AsyncCall)

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

LoopEnd (Continuation)

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

Example