Cancel all tasks.
Cancel all tasks. If a task has not yet begun running, it will simply be cancelled. If a task is already running, it will be interrupted. (see ZIO.interrupt)
Cancel the task with the given ID, and all currently queued or running tasks which were queued or started after the given task was queued or started.
List all currently running tasks
Queue a task, which can access a reference to the TaskInfo and modify it to broadcast updates.
Queue a task, which can access a reference to the TaskInfo and modify it to broadcast updates. When the given task finishes, errors, or is interrupted, a completion message of the appropriate status will be broadcast.
Evaluating the returned outer Task results in queueing of the given task, which will eventually cause the given task to be evaluated. Evaluating the inner Task results in blocking (asynchronously) until the given task completes.
Interrupting the inner Task results in cancelling the queued task, or interrupting it if it's running.
Note that status updates are sent somewhat lazily, and for a series of rapid updates to the task status only the last update might get sent.
Register an external task for status broadcasting and cancellation, by providing a function which will receive a function for modifying the TaskInfo and return a UIO that cancels the external task upon evaluation.
Register an external task for status broadcasting and cancellation, by providing a function which will receive a function for modifying the TaskInfo and return a UIO that cancels the external task upon evaluation. The cancellation task returned by the provided function may be evaluated even after the external task is finished.
The TaskInfo should be updated by invoking the function (TaskInfo => TaskInfo) => Unit, passing as an argument
the function which updates the status (e.g. _.progress(0.5)
).
The external task must report itself as being finished by updating the TaskInfo to a completed or failed state. All updates to the task reference will be broadcast. If cancelAll is run on this task manager, the given task will be interrupted (if it has not yet reported completion) using the return cancellation task.
Returns the Fiber which updates the task status. Interrupting this fiber results in the cancellation task returned from cancelCallback being evaluated.
Run the given task.
Run the given task. The task will be independent of the task queue, but will have access to a TaskInfo reference; it can update this reference to broadcast task updates. The first update will be broadcast when the task is evaluated, and a completion update will be broadcast when it completes or fails.
Run the given task as a subtask of the current task.
Run the given task as a subtask of the current task.
Shut down the task manager and stop executing any tasks in the queue.
Shut down the task manager and stop executing any tasks in the queue. Cancels all running tasks (see cancelAll)
This overload is more useful if the return type needs to be inferred