AsyncValueStream<T> class Null safety

The AsyncValueStream is used as a clearing house when more than one consumer need to update a single value, but you want to control the lifecycle around updates, so that older updates that take longer to calculate don't clobber newer values.

This allows for synchronous or asynchronous updates, but the last update to start will always "win", even if if finishes before another update that started before it.

Updates may be asynchronous, so they are queued up, and then processed in order. The current value is tracked as current

Implemented types
Mixed in types
Available Extensions

Constructors

AsyncValueStream({String? debugName, T? initialValue, bool isUnique = true, ClearingHouseMode mode = ClearingHouseMode.AllowSynchronousValues})

Properties

after Stream<T?>
read-only, override
current → T?
read-only
debugName String
The debug name for this stream
final
future Future<T>
read-only, override
hashCode int
The hash code for this object. [...]
read-only, inherited
isFirstResolved bool
read-only, override
isUnique bool
final
log Logger
Our logger
final
mode ClearingHouseMode
How updates are locked.
final
nextUpdate Future<T>
Waits until the next update completes
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

dispose() Future
disposeAll() Future
inherited
get() FutureOr<T?>
override
map<R>(R mapper(T? input)) ValueStream<R>
Basics of converting something over
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
registerDisposer(Disposer callback) → void
inherited
registerStream(Stream? stream) → void
inherited
registerSubscription(StreamSubscription? subscription) → void
inherited
removeDisposer(FutureOr dispose()) → void
inherited
resolve([T? ifAbsent]) → T?
override
syncUpdate(T current) FutureOr<T>
When setting a value in this way, we can assume that this update is the latest, and should cancel out any other in-flight requests
toString() String
A string representation of this object. [...]
inherited
update(Producer<T> current, {String? debugLabel, Duration? timeout, bool? fallbackToCurrent}) Future<T?>

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited