getAsync method

Future<T> getAsync()

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).

Implementation

Future<T> getAsync() async {
  if (_nodeDisposed) throw DisposedNodeError(this);
  if (_computeSync != null) return get() as T;
  if (_state == AsyncSlotState.resolved) {
    _ctx._track(this);
    return _value as T;
  }
  return _awaitResolved();
}