Skip to content

Add pause and resume support to the job system #3604

@erri120

Description

@erri120

Pausing is just cancellation that can be recovered from. The behavior is very similar, pausing a job means requesting cancellation on the cancellation token. Any code using the cancellation token will throw an OperationCanceledException as usual. The difference comes in the handling of the exception, instead of transitioning the job status to Cancelled we check a boolean isRequestingPause to either transition to the Cancelled or Paused state. This boolean will be set when someone is calling the Pause method on the job.

Additionally, a Resume method is required to transition from the Paused state back to a Running state. Note that this requires resetting internal state.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions