AsyncGeneratorGate class

The link from an async* body back to its listener (SCF4).

Without it a generator ran to completion whatever its subscriber did: a yield added its value and suspended on an already-completed future, so nothing could pause the body and nothing could stop it. The stream's onResume / onCancel now reach the body through this object.

Constructors

AsyncGeneratorGate()

Properties

cancelled ↔ bool
Set by the subscription's onCancel; read at every yield.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

afterYield(StreamController<Object?> controller) → Future<void>
What a yield waits on after adding its value.
cancel() → Future<void>
The subscription was cancelled. A waiting yield wakes and unwinds; the returned future completes once the body has run its finally blocks, which is when Dart completes StreamSubscription.cancel().
finished() → void
The body has finished, by any route.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resume() → void
The subscription resumed; a yield waiting on a pause continues.
toString() → String
A string representation of this object.
inherited

Operators

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