AgentAbort class

A cooperative cancellation signal for an AgentService run.

The host requests an abort (e.g. on Ctrl-C, or an abort answer at a prompt); the agent loop notices at its next checkpoint and stops. A bare request is unconfirmed — the loop asks the user "Abort? y/N" first; confirm marks it as already confirmed (an explicit abort answer), so the loop stops without re-asking. clear resets a request the user declined.

Pure Dart (no dart:io), so it works in the CLI and the browser.

Constructors

AgentAbort()

Properties

hashCode int
The hash code for this object.
no setterinherited
isConfirmed bool
Whether the abort is confirmed and the loop should stop without asking.
no setter
isRequested bool
Whether an abort has been requested (confirmed or not).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
whenRequested Future<void>
Completes the next time request is called — used to race against a pending model call so an abort is responsive. A fresh future is installed by clear after a declined request.
no setter

Methods

clear() → void
Clears a request the user declined, re-arming whenRequested.
confirm() → void
Marks a pending request as confirmed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request() → void
Requests an abort (idempotent). Wakes any whenRequested waiter.
requestConfirmed() → void
Requests an abort that needs no further confirmation (explicit intent).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited