Serializable semantic feedback for one correlated asynchronous operation.
Summary
Functions
Returns whether the operation can still receive lifecycle updates.
Finishes an active operation and clears active-only queue and cancellation state.
Builds a pending operation with stable identity and deterministic order.
Marks an active operation queued with scheduler-authored metadata.
Records valid domain-authored progress on an active operation.
Marks an active operation running and clears queue metadata.
Returns whether the operation has reached a semantic terminal status.
Types
@type active_status() :: :pending | :queued | :running
@type id() :: pos_integer()
@type kind() ::
:external_format
| :git_stage
| :git_unstage
| :git_discard
| :git_stage_all
| :git_unstage_all
| :git_commit
| :lsp_references
| :lsp_rename
@type resource() :: String.t()
@type status() :: active_status() | terminal_status()
@type t() :: %MingaEditor.State.Operation{ cancelable?: boolean(), id: id(), kind: kind(), message: String.t(), order: pos_integer(), progress: MingaEditor.State.OperationProgress.t() | nil, queue: MingaEditor.State.OperationQueue.t() | nil, resource: resource(), status: status() }
@type terminal_status() :: :success | :error | :timeout | :canceled | :stale
Functions
Returns whether the operation can still receive lifecycle updates.
@spec finish(t(), terminal_status(), String.t()) :: t()
Finishes an active operation and clears active-only queue and cancellation state.
Builds a pending operation with stable identity and deterministic order.
@spec queued(t(), String.t(), MingaEditor.State.OperationQueue.t()) :: t()
Marks an active operation queued with scheduler-authored metadata.
@spec report_progress(t(), MingaEditor.State.OperationProgress.t()) :: t()
Records valid domain-authored progress on an active operation.
Marks an active operation running and clears queue metadata.
Returns whether the operation has reached a semantic terminal status.