A thread of parallel, asynchronous execution within the Work of a
Task
An activity is any of:
An Eventual value (like a Promise, Future, Task,
Coroutine, etc.) whose result will become the task's result,
A function that EventuallyReturns a value that will become the
task's result, or
A Setup function that creates event listeners, reactive effects,
etc., that do the work of the task (and may optionally mark the work
completed via the work's .return() or
.throw()) methods.
Activities are used as parameters to the start() and
starting() functions (and Context methods of the same names),
as well as the .exec() method of Work contexts.
Multiple activities can run in the same Task context if they are the same
type, or are of type never. The first one to produce a result or cause the
task to end with an error will determine the task's final result, and all the
task's activities will be canceled/cleaned up.
Type Parameters
T = void
The type of result the activity will produce. A type of never
means the activity never produces a value, but instead will run until the task
is cleaned up, e.g. due to being canceled, ended with an error, etc.
A thread of parallel, asynchronous execution within the Work of a Task
An activity is any of:
Activities are used as parameters to the start() and starting() functions (and Context methods of the same names), as well as the .exec() method of Work contexts.
Multiple activities can run in the same Task context if they are the same type, or are of type
never. The first one to produce a result or cause the task to end with an error will determine the task's final result, and all the task's activities will be canceled/cleaned up.