ClaudeAgentSDK.AbortSignal (claude_agent_sdk v0.6.9)

View Source

Lightweight cancellation token shared with callbacks.

Callbacks receive this via :signal in their context and can poll cancelled?/1 to cooperatively stop work when a cancel or shutdown occurs.

Summary

Functions

Marks the signal as cancelled.

Returns true if the signal has been cancelled.

Creates a new abort signal.

Types

t()

@type t() :: %ClaudeAgentSDK.AbortSignal{ref: :atomics.atomics_ref()}

Functions

cancel(abort_signal)

@spec cancel(t()) :: :ok

Marks the signal as cancelled.

cancelled?(arg1)

@spec cancelled?(t() | nil) :: boolean()

Returns true if the signal has been cancelled.

new()

@spec new() :: t()

Creates a new abort signal.