ResourceControl class final
Coordinates explicit cleanup with accepted uses of one Dart object.
forObject returns the same control for the same object, including after its JavaScript wrapper has been collected and recreated. The association is weak; it does not keep an otherwise unreachable object alive or run cleanup for it. Bindings must validate compatible cleanup policies before sharing a control.
- Implemented types
Constructors
- ResourceControl.forObject(Object owner)
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → ResourceState
-
no setter
Methods
-
dispose(
FutureOr< void> cleanup()) → Future<void> -
Rejects new operations and runs
cleanuponce accepted leases are released. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
retainOperation(
) → OperationLease -
Retains the resource until the returned lease is released.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited