Table of Contents

Method TryCancelAsync

Namespace
Millrace.Storage.InMemory
Assembly
Millrace.dll

TryCancelAsync(JobId, CancellationToken)

Cancels a job. Atomic: Scheduled/Enqueued/Failed/Awaiting ⇒ Cancelled (FinishedAt set, key released, transitive Awaiting-descendant cascade) and returns true; Processing ⇒ sets CancelRequested only (state and fence untouched) and returns true; terminal or unknown ⇒ false, no mutation. CancelRequested never blocks a fenced ApplyAsync(JobTransition, CancellationToken) — a completing worker may still win with Succeeded.

public ValueTask<bool> TryCancelAsync(JobId id, CancellationToken ct)

Parameters

id JobId
ct CancellationToken

Returns

ValueTask<bool>