Skip to main content

Crate workflow_task

Crate workflow_task 

Source
Expand description

Abstraction for spawning and managing a re-startable async Task that runs a user-supplied async closure, exposing termination and completion channels for cooperative cancellation and result delivery.

Macros§

set_task
Assigns a task closure to an existing task source by expanding to a set_task_fn call on the given target with the supplied closure.
task
Constructs a workflow_task::Task from a closure or expression, wrapping the closure body so it is boxed and pinned as the task’s async future.

Structs§

Task
Task{self::Task} struct allows you to spawn an async fn that can run in a loop as a task (similar to a thread), checking for a termination signal (so that execution can be aborted), upon completion returning a value to the creator.

Enums§

TaskError
Errors produced by the Task implementation

Type Aliases§

FnReturn
Pinned, boxed future returned by a TaskFn, resolving to the task’s output value.
TaskFn
Boxed async closure executed by a Task, receiving the task argument and a termination Receiver and returning the task’s future via FnReturn.
TaskResult
Result type used by the Task implementation