Contains utility classes in the style of
dart:async to work with asynchronous
AsyncCache class allows expensive asynchronous
computations values to be cached for a period of time.
AsyncMemoizer class makes it easy to only run an
asynchronous operation once on demand.
CancelableOperation class 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 a
The delegating wrapper classes allow users to easily add functionality on top
of existing instances of core types from
dart:async. These include
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
future is a
Future<dynamic> and you know it actually contains an
int, you can write
FutureGroup class makes it easy to wait until a group of
features that may change over time completes.
LazyStream class allows a stream to be initialized lazily
.listen() is first called.
NullStreamSink class is an implementation of
StreamSink that discards all events.
RestartableTimer class extends
Timer with a
Result class that can hold either a value or an error. It
provides various utilities for converting to and from
StreamGroup class merges a collection of streams into a
single output stream.
StreamQueue class allows a stream to be consumed
event-by-event rather than being pushed whichever events as soon as they
StreamSplitter class allows a stream to be duplicated
into multiple identical streams.
StreamZip class combines multiple streams into a single
stream of lists of events.
This package contains a number of
SingleSubscriptionTransformer converts a
broadcast stream to a single-subscription stream, and
typedStreamTransformer casts the type of a
Stream. It also defines a transformer type for
SubscriptionStream class wraps a
StreamSubscription so it can be re-used as a
Streaminstead of implementing it. This ensures that new methods on
Streamare automatically picked up, they will go through the
listenmethod which type-checks every event.
FutureOrfor various APIs that had previously used
collectBytesCancelable functions which collects
list-of-byte events into a single byte list.
Fix a bug where rejecting a
StreamQueueTransaction would throw a
StreamQueue.rest had been called on one of its child queues.
StreamQueue.withTransaction() now properly returns whether or not the
transaction was committed.
AsyncCache class that caches asynchronous operations for a period of
These allow users to look at events without consuming them.
These allow users to conditionally consume events based on their values.
StreamQueue.cancelable(), which allows users to easily make a
CancelableOperation that can be canceled without affecting the queue.
StreamQueue.eventsDispatched which counts the number of events that have
been dispatched by a given queue.
subscriptionTransformer() function to create
modify the behavior of subscriptions to a stream.
typedStreamTransformer() function. This wraps an untyped
StreamTransformer with the correct type parameters, and asserts the types of
events as they're emitted from the transformed stream.
StreamSinkTransformer.typed() static method. This wraps an untyped
StreamSinkTransformer with the correct type parameters, and asserts the
types of arguments passed in to the resulting sink.
methods. These wrap untyped instances of these classes with the correct type
parameter, and assert the types of values as they're accessed.
DelegatingStream class. This is behaviorally identical to
dart:async, but it follows this package's naming conventions and
DelegatingStream.typed() static method.
Fix all strong mode warnings and add generic method annotations.
new DelegatingEventSink(), and
DelegatingStreamSink() now take arguments with generic type arguments (for
Stream<T>) rather than without (for example
Passing a type that wasn't
is-compatible with the fully-specified generic
would already throw an error under some circumstances, so this is not
considered a breaking change.
ErrorResult now takes a type parameter.
Result.asError now returns a
Deprecate top-level libraries other than
exports these libraries' interfaces.
Result.releaseSinkTransformer should be used instead.
StreamSinkCompleter, for creating a
StreamSink now and providing its
destination later as another sink.
StreamCompleter.setError, a shortcut for emitting a single error event
on the resulting stream.
NullStreamSink, an implementation of
StreamSink that discards all
StreamTransformerthat converts a broadcast stream into a single-subscription stream.
CancelableOperation.valueOrCancellation(), which allows users to be
notified when an operation is canceled elsewhere.
StreamSinkTransformer which transforms events before they're passed to
StreamSink, similarly to how
StreamTransformer transforms events after
they're emitted by a stream.
LazyStream, which forwards to the return value of a callback that's only called when the stream is listened to.
AsyncMemoizer.future, which allows the result to be accessed before
runOnce() is called.
CancelableOperation, an asynchronous operation that can be canceled.
It can be created using a
RestartableTimer, a non-periodic timer that can be reset over and
StreamCompleter class for creating a stream now and providing its
events later as another stream.
StreamQueue class which allows requesting events from a stream
before they are avilable. It is like a
StreamIterator that can queue
SubscriptionStream which creates a single-subscription stream
from an existing stream subscription.
ResultFuture class for synchronously accessing the result of a
FutureGroup.isIdle, which provide visibility
into whether a group is actively waiting on any futures.
AsyncMemoizer class for running an asynchronous block of code exactly
Added delegating wrapper classes for a number of core async types:
DelegatingStreamSubscription. These are all simple wrappers that forward all
calls to the wrapped objects. They can be used to expose only the desired
interface for subclasses, or extended to add extra functionality.
FutureGroup class for waiting for a group of futures, potentially of
unknown size, to complete.
StreamGroup class for merging the events of a group of streams,
potentially of unknown size.
StreamSplitter class for splitting a stream into multiple new
Add this to your package's pubspec.yaml file:
dependencies: async: "^1.13.3"
You can install packages from the command line:
$ pub get
Alternatively, your editor might support 'pub get'. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|1.13.3||May 17, 2017||Go to the documentation of async 1.13.3||Download async 1.13.3 archive|
|1.13.2||Feb 20, 2017||Go to the documentation of async 1.13.2||Download async 1.13.2 archive|
|1.13.1||Feb 15, 2017||Go to the documentation of async 1.13.1||Download async 1.13.1 archive|
|1.13.0||Feb 6, 2017||Go to the documentation of async 1.13.0||Download async 1.13.0 archive|
|1.12.0||Jan 24, 2017||Go to the documentation of async 1.12.0||Download async 1.12.0 archive|
|1.11.3||Oct 24, 2016||Go to the documentation of async 1.11.3||Download async 1.11.3 archive|
|1.11.2||Sep 27, 2016||Go to the documentation of async 1.11.2||Download async 1.11.2 archive|
|1.11.1||Jul 19, 2016||Go to the documentation of async 1.11.1||Download async 1.11.1 archive|
|1.11.0||May 9, 2016||Go to the documentation of async 1.11.0||Download async 1.11.0 archive|
|1.10.0||Apr 12, 2016||Go to the documentation of async 1.10.0||Download async 1.10.0 archive|