async 2.13.0
async: ^2.13.0 copied to clipboard
Utility functions and classes related to the 'dart:async' library.
2.13.0 #
- Fix type check and cast in SubscriptionStream's cancelOnError wrapper
2.12.0 #
- Require Dart 3.4.
- Move to
dart-lang/coremonorepo.
2.11.0 #
- Add
CancelableOperation.fromValue. - Add
StreamExtensions.listenAndBuffer, which buffers events from a stream before it has a listener.
2.10.0 #
- Add
CancelableOperation.thenOperationwhich gives more flexibility to complete the resulting operation. - Add
CancelableCompleter.completeOperation. - Require Dart 2.18.
2.9.0 #
- Potentially Breaking The default
propagateCancelargument toCancelableOperation.thenchanged fromfalsetotrue. 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 anyCancelableOperationwith multiple listeners where canceling subsequent computation using.thenshouldn't also cancel the original operation, passpropagateCancel: false. - Add
StreamExtensions.firstOrNull. - Add a
CancelableOperation.fromSubscription()static factory. - Add a
CancelableOperation.race()static method. - Update
StreamGroupmethods that return aFuture<dynamic>today to return aFuture<void>instead. - Deprecated
AsyncCache.fetchStream. - Make
AsyncCache.ephemeralinvalidate itself immediately when the returned future completes, rather than wait for a later timer event.
2.8.2 #
- Deprecate
EventSinkBase,StreamSinkBase,IOSinkBase.
2.8.1 #
- 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.
2.8.0 #
- Add
EventSinkBase,StreamSinkBase, andIOSinkBaseclasses to make it easier to implement custom sinks. - Improve performance for
ChunkedStreamReaderby creating fewer internal sublists and specializing to create views forUint8Listchunks.
2.7.0 #
- Add a
Stream.slices()extension method. - Fix a bug where
CancelableOperation.thenmay invoke theonValuecallback, even if it had been canceled beforeCancelableOperation.valuecompletes. - 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.
2.6.1 #
- When
StreamGroup.stream.listen()is called, gracefully handle component streams throwing errors when theirStream.listen()methods are called.
2.6.0 #
- Add a
StreamCloserclass, which is aStreamTransformerthat allows the caller to force the stream to emit a done event. - Added
ChunkedStreamReaderfor reading chunked streams without managing buffers. - Add extensions on
StreamSink, includingStreamSink.transform()for applyingStreamSinkTransformers andStreamSink.rejectErrors(). - Add
StreamGroup.isIdleandStreamGroup.onIdle. - Add
StreamGroup.isClosedandFutureGroup.isClosedgetters.
2.5.0 #
- Stable release for null safety.
2.5.0-nullsafety.3 #
- Update SDK constraints to
>=2.12.0-0 <3.0.0based on beta release guidelines.
2.5.0-nullsafety.2 #
- 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.
2.5.0-nullsafety.1 #
- Allow 2.10 stable and 2.11.0 dev SDK versions.
2.5.0-nullsafety #
- Migrate this package to null safety.
2.4.2 #
StreamQueuestarts listening immediately to broadcast strings.
2.4.1 #
- Deprecate
DelegatingStream.typed. UseStream.castinstead. - Deprecate
DelegatingStreamSubcription.typedandDelegatingStreamConsumer.typed. For each of these theStreamshould be cast to the correct type before being used. - Deprecate
DelegatingStreamSink.typed.DelegatingSink.typed,DelegatingEventSink.typed,DelegatingStreamConsumer.typed. For each of these a newStreamControllercan be constructed to forward to the sink.StreamController<T>()..stream.cast<S>().pipe(sink) - Deprecate
typedStreamTransformer. Cast after transforming instead. - Deprecate
StreamSinkTransformer.typedsince there was no usage. - Improve docs for
CancelablOperation.fromFuture, indicate thatisCompletedstartstrue.
2.4.0 #
- Add
StreamGroup.mergeBroadcast()utility.
2.3.0 #
- Implement
RestartableTimer.tick.
2.2.0 #
- Add
thentoCancelableOperation.
2.1.0 #
- Fix
CancelableOperation.valueOrCancellation's type signature - Add
isCanceledandisCompletedtoCancelableOperation.
2.0.8 #
- Set max SDK version to
<3.0.0. - Deprecate
DelegatingFuture.typed, it is not necessary in Dart 2.
2.0.7 #
- Fix Dart 2 runtime errors.
- Stop using deprecated constants from the SDK.
2.0.6 #
- Add further support for Dart 2.0 library changes to
Stream.
2.0.5 #
- Fix Dart 2.0 runtime cast errors in
StreamQueue.
2.0.4 #
-
Add support for Dart 2.0 library changes to
StreamandStreamTransformer. Changed classes that implementStreamTransformerto extendStreamTransformerBase, and changed signatures offirstWhere,lastWhere, andsingleWhereon classes extendingStream. See also issue 31847.
2.0.3 #
- Fix a bug in
StreamQueue.startTransaction()and related methods when rejecting a transaction that isn't the oldest request in the queue.
2.0.2 #
- Add support for Dart 2.0 library changes to class
Timer.
2.0.1 #
- Fix a fuzzy arrow type warning.
2.0.0 #
-
Remove deprecated public
result.dartandstream_zip.dartlibraries and deprecated classesReleaseStreamTransformerandCaptureStreamTransformer. -
Add
captureAllandflattenListstatic methods toResult. -
Change
ErrorResultto not be generic and always be aResult<Null>. That makes an error independent of the type of result it occurs instead of.
1.13.3 #
- Make
TypeSafeStreamextendStreaminstead of implementing it. This ensures that new methods onStreamare automatically picked up, they will go through thelistenmethod which type-checks every event.
1.13.2 #
- Fix a type-warning.
1.13.1 #
- Use
FutureOrfor various APIs that had previously useddynamic.
1.13.0 #
-
Add
collectBytesandcollectBytesCancelablefunctions which collects list-of-byte events into a single byte list. -
Fix a bug where rejecting a
StreamQueueTransactionwould throw aStateErrorifStreamQueue.resthad been called on one of its child queues. -
StreamQueue.withTransaction()now properly returns whether or not the transaction was committed.
1.12.0 #
-
Add an
AsyncCacheclass that caches asynchronous operations for a period of time. -
Add
StreamQueue.peekandStreamQueue.lookAheead. These allow users to look at events without consuming them. -
Add
StreamQueue.startTransaction()andStreamQueue.withTransaction(). These allow users to conditionally consume events based on their values. -
Add
StreamQueue.cancelable(), which allows users to easily make aCancelableOperationthat can be canceled without affecting the queue. -
Add
StreamQueue.eventsDispatchedwhich counts the number of events that have been dispatched by a given queue. -
Add a
subscriptionTransformer()function to createStreamTransformers that modify the behavior of subscriptions to a stream.
1.11.3 #
- Fix strong-mode warning against the signature of Future.then
1.11.1 #
- Fix new strong-mode warnings introduced in Dart 1.17.0.
1.11.0 #
-
Add a
typedStreamTransformer()function. This wraps an untypedStreamTransformerwith the correct type parameters, and asserts the types of events as they're emitted from the transformed stream. -
Add a
StreamSinkTransformer.typed()static method. This wraps an untypedStreamSinkTransformerwith the correct type parameters, and asserts the types of arguments passed in to the resulting sink.
1.10.0 #
-
Add
DelegatingFuture.typed(),DelegatingStreamSubscription.typed(),DelegatingStreamConsumer.typed(),DelegatingSink.typed(),DelegatingEventSink.typed(), andDelegatingStreamSink.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. -
Add a
DelegatingStreamclass. This is behaviorally identical toStreamViewfromdart:async, but it follows this package's naming conventions and provides aDelegatingStream.typed()static method. -
Fix all strong mode warnings and add generic method annotations.
-
new StreamQueue(),new SubscriptionStream(),new DelegatingStreamSubscription(),new DelegatingStreamConsumer(),new DelegatingSink(),new DelegatingEventSink(), andnew DelegatingStreamSink()now take arguments with generic type arguments (for exampleStream<T>) rather than without (for exampleStream<dynamic>). Passing a type that wasn'tis-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 aResult<T>.
1.9.0 #
-
Deprecate top-level libraries other than
package:async/async.dart, which exports these libraries' interfaces. -
Add
Result.captureStreamTransformer,Result.releaseStreamTransformer,Result.captureSinkTransformer, andResult.releaseSinkTransformer. -
Deprecate
CaptureStreamTransformer,ReleaseStreamTransformer,CaptureSink, andReleaseSink.Result.captureStreamTransformer,Result.releaseStreamTransformer,Result.captureSinkTransformer, andResult.releaseSinkTransformershould be used instead.
1.8.0 #
-
Added
StreamSinkCompleter, for creating aStreamSinknow and providing its destination later as another sink. -
Added
StreamCompleter.setError, a shortcut for emitting a single error event on the resulting stream. -
Added
NullStreamSink, an implementation ofStreamSinkthat discards all events.
1.7.0 #
- Added
SingleSubscriptionTransformer, aStreamTransformerthat converts a broadcast stream into a single-subscription stream.
1.6.0 #
-
Added
CancelableOperation.valueOrCancellation(), which allows users to be notified when an operation is canceled elsewhere. -
Added
StreamSinkTransformerwhich transforms events before they're passed to aStreamSink, similarly to howStreamTransformertransforms events after they're emitted by a stream.
1.5.0 #
- Added
LazyStream, which forwards to the return value of a callback that's only called when the stream is listened to.
1.4.0 #
-
Added
AsyncMemoizer.future, which allows the result to be accessed beforerunOnce()is called. -
Added
CancelableOperation, an asynchronous operation that can be canceled. It can be created using aCancelableCompleter. -
Added
RestartableTimer, a non-periodic timer that can be reset over and over.
1.3.0 #
-
Added
StreamCompleterclass for creating a stream now and providing its events later as another stream. -
Added
StreamQueueclass which allows requesting events from a stream before they are avilable. It is like aStreamIteratorthat can queue requests. -
Added
SubscriptionStreamwhich creates a single-subscription stream from an existing stream subscription. -
Added a
ResultFutureclass for synchronously accessing the result of a wrapped future. -
Added
FutureGroup.onIdleandFutureGroup.isIdle, which provide visibility into whether a group is actively waiting on any futures. -
Add an
AsyncMemoizerclass for running an asynchronous block of code exactly once. -
Added delegating wrapper classes for a number of core async types:
DelegatingFuture,DelegatingStreamConsumer,DelegatingStreamController,DelegatingSink,DelegatingEventSink,DelegatingStreamSink, andDelegatingStreamSubscription. 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.
1.2.0 #
-
Added a
FutureGroupclass for waiting for a group of futures, potentially of unknown size, to complete. -
Added a
StreamGroupclass for merging the events of a group of streams, potentially of unknown size. -
Added a
StreamSplitterclass for splitting a stream into multiple new streams.
1.1.1 #
- Updated SDK version constraint to at least 1.9.0.
1.1.0 #
- ChangeLog starts here.