ProtoFlux:Start Async Task: Difference between revisions

From Resonite Wiki
fix sub title
no async context
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
|}}
|}}


Because Async is a complicated subject, please see [[Impulses#ASync|ASync Tasks]] For more information on how Async works and how this node can be used.
The '''Start Async Task''' node starts a new [[ExecutionContext]] using [[async flow]] at the current impulse.


Start ASync Task is a ProtoFlux node that takes an impulse and starts an Async task.
== Inputs ==
== Inputs ==


=== * ([[Impulses|Call]]) ===
=== * ([[Impulses|Call]]) ===


Start an [[Impulses#ASync|ASync]] task.
Start the async task.


== Outputs ==
== Outputs ==
Line 27: Line 26:
=== TaskStart ([[Impulses#ASync|AsyncResumption]]) ===
=== TaskStart ([[Impulses#ASync|AsyncResumption]]) ===


Impulses when * ([[Impulses|Call]]) and is a new async task context.
The new ExecutionContext made by the node. This impulse chain is [[async]] and will run until it encounters any sort of delay, at which it will continue execution along the <code>OnStarted</code> chain and follow standard sync/async flow.
 
The context made by this node is ''nested'', meaning that any context-specific things, such as [[ProtoFlux:Local|locals]], are duplicated from the context that <code>*</code> comes from. Any future changes to context-specific things will not be reflected in the <code>OnStarted</code> chain and vice versa.


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


Fires at the exact same time as TaskStart and fires after * ([[Impulses|Call]]) is called.
Fires once <code>TaskStart</code> encounters any sort of delay, effectively running at the same time given the now-separate contexts.


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


Fires after * ([[Impulses|Call]]) was called and the task was not started. (TODO: Why?)
Fires if the task was unable to be started. This only fires if <code>TaskStart</code> is not connected to any node.
 
== See Also ==


== Examples ==
* [[Impulses#Async]] for more information about async flow.
<gallery widths=480px heights=480px>
* [[ExecutionContext]] for more information about the context this node creates.
File:Protoflux_example_Start_ASync_Task.webp|Start ASync Task being used to start a task for a [[ProtoFlux:Read Cloud Variable|Read Cloud Variable Node]].
</gallery>


[[Category:ProtoFlux:Flow:Async]]
[[Category:ProtoFlux:Flow:Async]]

Latest revision as of 20:52, 29 January 2025

Start Async Task
*
TaskStart
OnStarted
OnFailed
Async

The Start Async Task node starts a new ExecutionContext using async flow at the current impulse.

Inputs

* (Call)

Start the async task.

Outputs

TaskStart (AsyncResumption)

The new ExecutionContext made by the node. This impulse chain is async and will run until it encounters any sort of delay, at which it will continue execution along the OnStarted chain and follow standard sync/async flow.

The context made by this node is nested, meaning that any context-specific things, such as locals, are duplicated from the context that * comes from. Any future changes to context-specific things will not be reflected in the OnStarted chain and vice versa.

OnStarted (Continuation)

Fires once TaskStart encounters any sort of delay, effectively running at the same time given the now-separate contexts.

OnFailed (Continuation)

Fires if the task was unable to be started. This only fires if TaskStart is not connected to any node.

See Also