ResourceHandle class abstract
A disposable resource handle that participates in cancellation (FR-004, FR-006). Examples: webview pool entry, network request, open stream.
On cancellation, the kernel calls dispose inside the grace-period race. Resources that fail to dispose within the grace window are reported by the post-cancellation leak assertion (FR-006).
Constructors
Properties
- handleId → String
-
Human-readable identifier for diagnostics.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether the resource has been disposed. Read by the post-cancellation
leak assertion (
CancelToken.leaked, FR-006) to detect handles that failed to release within the grace period. Real implementations MUST override this to reflect their actual disposal state; the default (false) assumes not disposed so a non-overriding implementation is reported as leaked rather than silently passed as cleanly released.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> - Disposes the resource. MUST be safe to call multiple times (idempotent). Returns a Future that completes once the resource is released.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited