async 2.9.0 async: ^2.9.0 copied to clipboard
Utility functions and classes related to the 'dart:async' library.
- Potentially Breaking The default
true. In most usages this won't have a meaningful difference in behavior, but in usages where the behavior is important propagation is the more common need. If there are any
CancelableOperationwith multiple listeners where canceling subsequent computation using
.thenshouldn't also cancel the original operation, pass
- Add a
- Add a
StreamGroupmethods that return a
Future<dynamic>today to return a
AsyncCache.ephemeralinvalidate itself immediately when the returned future completes, rather than wait for a later timer event.
- Don't ignore broadcast streams added to a
StreamGroupthat doesn't have an active listener but previously had listeners and contains a single subscription inner stream.
IOSinkBaseclasses to make it easier to implement custom sinks.
- Improve performance for
ChunkedStreamReaderby creating fewer internal sublists and specializing to create views for
- Add a
- Fix a bug where
CancelableOperation.thenmay invoke the
onValuecallback, even if it had been canceled before
- Fix a bug in
CancelableOperation.isCompletewhere it may appear to be complete and no longer be cancelable when it in fact could still be canceled.
StreamGroup.stream.listen()is called, gracefully handle component streams throwing errors when their
Stream.listen()methods are called.
- Add a
StreamCloserclass, which is a
StreamTransformerthat allows the caller to force the stream to emit a done event.
ChunkedStreamReaderfor reading chunked streams without managing buffers.
- Add extensions on
- Stable release for null safety.
- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
- Remove the unusable setter
CancelableOperation.operation=. This was mistakenly added to the public API but could never be called.
- Allow 2.12.0 dev SDK versions.
- Allow 2.10 stable and 2.11.0 dev SDK versions.
- Migrate this package to null safety.
StreamQueuestarts listening immediately to broadcast strings.
DelegatingStreamConsumer.typed. For each of these the
Streamshould be cast to the correct type before being used.
DelegatingStreamConsumer.typed. For each of these a new
StreamControllercan be constructed to forward to the sink.
typedStreamTransformer. Cast after transforming instead.
StreamSinkTransformer.typedsince there was no usage.
- Improve docs for
CancelablOperation.fromFuture, indicate that
CancelableOperation.valueOrCancellation's type signature
- Set max SDK version to
DelegatingFuture.typed, it is not necessary in Dart 2.
- Fix Dart 2 runtime errors.
- Stop using deprecated constants from the SDK.
- Add further support for Dart 2.0 library changes to
Add support for Dart 2.0 library changes to
StreamTransformer. Changed classes that implement
StreamTransformerBase, and changed signatures of
singleWhereon classes extending
Stream. See also issue 31847.
- Fix a bug in
StreamQueue.startTransaction()and related methods when rejecting a transaction that isn't the oldest request in the queue.
- Add support for Dart 2.0 library changes to class
- Fix a fuzzy arrow type warning.
Remove deprecated public
stream_zip.dartlibraries and deprecated classes
flattenListstatic methods to
ErrorResultto not be generic and always be a
Result<Null>. That makes an error independent of the type of result it occurs instead of.
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.
- Fix a type-warning.
FutureOrfor various APIs that had previously used
collectBytesCancelablefunctions which collects list-of-byte events into a single byte list.
Fix a bug where rejecting a
StreamQueueTransactionwould throw a
StreamQueue.resthad been called on one of its child queues.
StreamQueue.withTransaction()now properly returns whether or not the transaction was committed.
AsyncCacheclass that caches asynchronous operations for a period of time.
StreamQueue.lookAheead. These allow users to look at events without consuming them.
StreamQueue.withTransaction(). These allow users to conditionally consume events based on their values.
StreamQueue.cancelable(), which allows users to easily make a
CancelableOperationthat can be canceled without affecting the queue.
StreamQueue.eventsDispatchedwhich counts the number of events that have been dispatched by a given queue.
subscriptionTransformer()function to create
StreamTransformers that modify the behavior of subscriptions to a stream.
- Fix strong-mode warning against the signature of Future.then
- Fix new strong-mode warnings introduced in Dart 1.17.0.
typedStreamTransformer()function. This wraps an untyped
StreamTransformerwith 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
StreamSinkTransformerwith the correct type parameters, and asserts the types of arguments passed in to the resulting sink.
DelegatingStreamSink.typed()static methods. These wrap untyped instances of these classes with the correct type parameter, and assert the types of values as they're accessed.
DelegatingStreamclass. This is behaviorally identical to
dart:async, but it follows this package's naming conventions and provides a
Fix all strong mode warnings and add generic method annotations.
new DelegatingEventSink(), and
new DelegatingStreamSink()now take arguments with generic type arguments (for example
Stream<T>) rather than without (for example
Stream<dynamic>). 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.
ErrorResultnow takes a type parameter.
Result.asErrornow returns a
Deprecate top-level libraries other than
package:async/async.dart, which exports these libraries' interfaces.
Result.releaseSinkTransformershould be used instead.
StreamSinkCompleter, for creating a
StreamSinknow 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
StreamSinkthat discards all events.
StreamTransformerthat converts a broadcast stream into a single-subscription stream.
CancelableOperation.valueOrCancellation(), which allows users to be notified when an operation is canceled elsewhere.
StreamSinkTransformerwhich transforms events before they're passed to a
StreamSink, similarly to how
StreamTransformertransforms 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
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 over.
StreamCompleterclass for creating a stream now and providing its events later as another stream.
StreamQueueclass which allows requesting events from a stream before they are avilable. It is like a
StreamIteratorthat can queue requests.
SubscriptionStreamwhich creates a single-subscription stream from an existing stream subscription.
ResultFutureclass for synchronously accessing the result of a wrapped future.
FutureGroup.isIdle, which provide visibility into whether a group is actively waiting on any futures.
AsyncMemoizerclass for running an asynchronous block of code exactly once.
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.
FutureGroupclass for waiting for a group of futures, potentially of unknown size, to complete.
StreamGroupclass for merging the events of a group of streams, potentially of unknown size.
StreamSplitterclass for splitting a stream into multiple new streams.
- Updated SDK version constraint to at least 1.9.0.
- ChangeLog starts here.