The type of result the function produces; use never for an
activity that keeps running until canceled and won't ever call
work.return() either.
The type of this the function accepts, if using the
deprecated two-argument start() form, or boundTo().
When you create an activity function that takes an explicit work
or self argument (to receive the work context), you need to either
explicitly type it (e.g. function*(self: Work<number>){}) or provide a type
parameter to the thing you're calling it with (e.g.
start<number>(function*(self){...})), or you'll end up with a
Work<unknown>, which is probably not what you want.
A function implementing a Task, or an Activity within a task
An activity function is a function run within a task's Scope and passed its Work. Either the function:
Does the work itself (e.g. as a generator function returning a Coroutine, or an async function returning a Promise),
Delegates it to a returned Eventual value, or
Synchronously sets up the activity (by wiring listeners, signals, etc.), to eventually call
work.return()orwork.throw()to finish the task. (If applicable, that is! Some tasks or activities are simply meant to run until canceled.) A synchronous Setup function can also return an optional cleanup function, in lieu of passing it tomust().