AsyncSlotHandle<T> class
A computed async slot handle.
Wraps a Future-returning computation that recomputes when its
dependencies change. Holds the cached value when state is
AsyncSlotState.resolved, the in-flight future + revision when
computing, or the error when error.
- Implemented types
Constructors
-
AsyncSlotHandle(AsyncContext _ctx, Future<
T> compute(AsyncComputeContext ctx), {Equals<T> ? eq}) -
AsyncSlotHandle.sync(AsyncContext _ctx, T compute(AsyncComputeContext ctx), {Equals<
T> ? eq})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether this slot has been disposed. A disposed slot reads as a
DisposedNodeError.
no setter
- revision → int
-
The current revision (incremented on each invalidation; a completing
future with a stale revision is discarded).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → AsyncSlotState
-
The current state-machine state.
no setter
- value → T?
-
The cached value when resolved;
nullotherwise.no setter
Methods
-
get(
) → T? - Synchronous cached read.
-
getAsync(
) → Future< T> - Await a slot value; uses get for resolved slots, otherwise spawns async compute. Concurrent callers await the same in-flight result instead of spawning duplicate futures (in-flight deduplication).
-
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