LemonAgent. Tools. AbortHelpers
(lemon_agent v0.1.0)
View Source
Shared abort-signal helpers used across tool implementations.
Provides two styles of abort checking:
aborted?/1– boolean check, useful inifguardscheck_abort/1– returns:ok | {:error, "Operation aborted"}, useful inwithchainscheck_aborted/1– returns:ok | {:error, :aborted}, used by tools that pattern-match on the atom
Summary
Functions
Returns true when the signal has been aborted, false otherwise.
Safely handles nil (no signal).
Returns :ok when the signal has not been aborted,
or {:error, "Operation aborted"} when it has.
Safely handles nil and non-reference values.
Returns :ok when the signal has not been aborted,
or {:error, :aborted} when it has.
Safely handles nil and non-reference values.
Functions
Returns true when the signal has been aborted, false otherwise.
Safely handles nil (no signal).
Returns :ok when the signal has not been aborted,
or {:error, "Operation aborted"} when it has.
Safely handles nil and non-reference values.
@spec check_aborted(reference() | nil) :: :ok | {:error, :aborted}
Returns :ok when the signal has not been aborted,
or {:error, :aborted} when it has.
Safely handles nil and non-reference values.