pub enum TaskEvent {
Progress {
task: TaskId,
value: f64,
},
Finished {
task: TaskId,
},
Failed {
task: TaskId,
message: String,
},
Aborted {
widget_id: WidgetId,
command: TaskCommandKind,
reason: TaskAbortReason,
},
}Expand description
Lifecycle notification for one background task, delivered to the UI
thread as crate::UiEvent::Task.
Variants§
Progress
Intermediate progress reported through UiProxy::progress.
Finished
The task finished (completed or cancelled — the app decides which).
Failed
The task failed; message is app-defined (e.g. an I/O error).
Aborted
A queued widget command was aborted before it could apply: its target was tombstoned by a teardown, or a live target refused the mutation.
One event is emitted per aborted command, in drain order, and the
same commands are counted by TaskDrainReport::rejected. This is
the dead-letter notification the lossless guarantees need: a worker
whose final commit lost its widget learns about it instead of facing
silence. Treat the first abort for a tombstoned widget as the signal
to stop that worker.
Fields
command: TaskCommandKindWhich command was aborted.
reason: TaskAbortReasonWhy the command did not apply.