added info, no longer stub |
AsyncCall not SyncResumption |
||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
|Outputs= | |Outputs= | ||
[ | [ | ||
{"Name": "LoopStart", "Type":" | {"Name": "LoopStart", "Type":"AsyncCall"}, | ||
{"Name": "LoopIteration", "Type":" | {"Name": "LoopIteration", "Type":"AsyncCall"}, | ||
{"Name": "LoopEnd", "Type":"Continuation"} | {"Name": "LoopEnd", "Type":"Continuation"} | ||
] | ] | ||
|}} | |}} | ||
ASync While is a ProtoFlux node that will wait for every ASync node fired by LoopStart ([[Impulses#ASync| | ASync While is a ProtoFlux node that will wait for every ASync node fired by LoopStart ([[Impulses#ASync|AsyncCall]]) and LoopIteration ([[Impulses#ASync|AsyncCall]]) 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| | {{Template:Note|Caution should be used when using this node. giving it no nodes to fire on LoopIteration ([[Impulses#ASync|AsyncCall]]) 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 == | ||
=== * ([[Impulses#ASync| | === * ([[Impulses#ASync|IAsyncOperation]]) === | ||
Call this to start execution of the loop. | Call this to start execution of the loop. | ||
Line 27: | Line 27: | ||
=== Condition ([[Type:Bool|bool]]) === | === Condition ([[Type:Bool|bool]]) === | ||
The execution will check this after every finished LoopIteration ([[Impulses#ASync| | The execution will check this after every finished LoopIteration ([[Impulses#ASync|AsyncCall]]) and will fire the next LoopIteration ([[Impulses#ASync|AsyncCall]]) if the provided Condition is true. | ||
== Outputs == | == Outputs == | ||
=== LoopStart ([[Impulses#ASync| | === LoopStart ([[Impulses#ASync|AsyncCall]]) === | ||
Fires once * ([[Impulses#ASync| | Fires once * ([[Impulses#ASync|IAsyncOperation]]) is called before even checking if this node can execute. | ||
=== LoopIteration ([[Impulses#ASync| | === LoopIteration ([[Impulses#ASync|AsyncCall]]) === | ||
Fires once the previous LoopIteration ([[Impulses#ASync| | Fires once the previous LoopIteration ([[Impulses#ASync|AsyncCall]]) has fired and finished or LoopStart ([[Impulses#ASync|AsyncCall]]) has fired and finished. | ||
=== LoopEnd ([[Impulses|Continuation]]) === | === LoopEnd ([[Impulses|Continuation]]) === | ||
Fires after a LoopIteration ([[Impulses#ASync| | Fires after a LoopIteration ([[Impulses#ASync|AsyncCall]]) has fired and Condition ([[Type:Bool|bool]]) is false. | ||
== Example == | == Example == |
Latest revision as of 22:48, 16 February 2024
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.
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
-
ASync while being used to do website requests repeatedly until X becomes true.