Skip to contents

Create mutable cancellation tokens and execute analysis plans or registries with cooperative cancellation at deterministic module-launch boundaries.

Usage

new_execution_cancellation_token(label = "execution-cancellation")

# S3 method for class 'PopgenVCFExecutionCancellationToken'
print(x, ...)

request_execution_cancellation(token, reason = "Cancellation requested")

validate_execution_cancellation_token(token)

execute_analysis_plan_with_cancellation(
  analysis,
  context,
  registry,
  plan,
  cancellation_token = new_execution_cancellation_token(),
  engine = new_execution_engine(fail_fast = FALSE),
  retry_policy = new_execution_retry_policy(),
  checkpoint_path = NULL
)

execute_analysis_registry_with_cancellation(
  analysis,
  context,
  registry,
  selected = NULL,
  cancellation_token = new_execution_cancellation_token(),
  engine = new_execution_engine(fail_fast = FALSE),
  retry_policy = new_execution_retry_policy(),
  checkpoint_path = NULL
)

Arguments

label

Stable token identifier recorded in execution metadata.

x

A cancellation token.

...

Unused.

token

A PopgenVCFExecutionCancellationToken.

reason

Human-readable cancellation reason.

analysis

A PopgenVCFAnalysis object.

context

Runtime context shared by module runners.

registry

A PopgenVCFRegistry object.

plan

A PopgenVCFExecutionPlan object.

cancellation_token

Cancellation token checked before module launch.

engine

Execution engine.

retry_policy

Retry policy. Cancellation is always non-retryable.

checkpoint_path

Optional path for a checkpoint written after cancellation.

selected

Optional module names.

Value

The constructor returns a mutable cancellation token. The execution functions return the standard execution result with cancellation metadata and, when cancellation was requested, a validated execution checkpoint.

Details

Cancellation is cooperative. It is observed before a module runner starts. Already validated outputs remain valid, while a module that has not started contributes no output or artifact. Cancelled attempts are never retried, even when a caller supplies a broad retry predicate. The generated checkpoint can be passed to resume_analysis_execution().