async 2.4.0
async: ^2.4.0 copied to clipboard
Utility functions and classes related to the 'dart:async' library.
Contains utility classes in the style of dart:async to work with asynchronous
computations.
-
The
AsyncCacheclass allows expensive asynchronous computations values to be cached for a period of time. -
The
AsyncMemoizerclass makes it easy to only run an asynchronous operation once on demand. -
The
CancelableOperationclass defines an operation that can be canceled by its consumer. The producer can then listen for this cancellation and stop producing the future when it's received. It can be created using aCancelableCompleter. -
The delegating wrapper classes allow users to easily add functionality on top of existing instances of core types from
dart:async. These includeDelegatingFuture,DelegatingStream,DelegatingStreamSubscription,DelegatingStreamConsumer,DelegatingSink,DelegatingEventSink, andDelegatingStreamSink.The delegating classes all have
.typed()constructors which allow users to cast the generic type parameters in a way that's safe for strong mode. For example, iffutureis aFuture<dynamic>and you know it actually contains anint, you can writeDelegatingFuture.typed<int>(future). -
The
FutureGroupclass makes it easy to wait until a group of features that may change over time completes. -
The
LazyStreamclass allows a stream to be initialized lazily when.listen()is first called. -
The
NullStreamSinkclass is an implementation ofStreamSinkthat discards all events. -
The
RestartableTimerclass extendsTimerwith areset()method. -
The
Resultclass that can hold either a value or an error. It provides various utilities for converting to and fromFutures andStreams. -
The
StreamGroupclass merges a collection of streams into a single output stream. -
The
StreamQueueclass allows a stream to be consumed event-by-event rather than being pushed whichever events as soon as they arrive. -
The
StreamSplitterclass allows a stream to be duplicated into multiple identical streams. -
The
StreamZipclass combines multiple streams into a single stream of lists of events. -
This package contains a number of
StreamTransformers.SingleSubscriptionTransformerconverts a broadcast stream to a single-subscription stream, andtypedStreamTransformercasts the type of aStream. It also defines a transformer type forStreamSinks,StreamSinkTransformer. -
The
SubscriptionStreamclass wraps aStreamSubscriptionso it can be re-used as aStream.