quiver.async library

Classes

CountdownTimer
A simple countdown timer that fires events in regular increments until a duration has passed. [...]
FutureStream<T>
A Stream that will emit the same values as the stream returned by future once future completes. [...]
Metronome
A stream of DateTime events at intervals centered on anchor. [...]
StreamBuffer<T>
Allow orderly reading of elements from a datastream, such as Socket, which might not receive List<int> bytes regular chunks. [...]
StreamRouter<T>
Splits a Stream of events into multiple Streams based on a set of predicates. [...]

Functions

collect<T>(Iterable<Future<T>> futures) Stream<T>
Returns a stream of completion events for the input futures. [...]
concat<T>(Iterable<Stream<T>> streams) Stream<T>
Returns the concatentation of the input streams. [...]
doWhileAsync<T>(Iterable<T> iterable, AsyncAction<bool, T> action) Future<bool>
Calls action for each item in iterable in turn, waiting for the Future returned by action to complete. [...]
enumerate<T>(Stream<T> stream) Stream<IndexedValue<T>>
Returns a Stream of IndexedValues where the nth value holds the nth element of stream and its index.
forEachAsync<T>(Iterable<T> iterable, AsyncAction<Null, T> action, { int maxTasks: 1 }) Future<Null>
Schedules calls to action for each element in iterable. No more than maxTasks calls to action will be pending at once.
reduceAsync<S, T>(Iterable<T> iterable, S initialValue, AsyncCombiner<S, T> combine) Future<S>
Reduces a collection to a single value by iteratively combining elements of the collection using the provided combine function. Similar to Iterable.reduce, except that combine is an async function that returns a Future.

Typedefs

AsyncAction<T, E>(E e) Future<T>
An asynchronous callback that returns a value.
AsyncCombiner<T, E>(T previous, E e) Future<T>
An asynchronous funcuntion that combines an element e with a previous value previous, for use with reduceAsync.

Exceptions / Errors

UnderflowError
Underflow errors happen when the socket feeding a buffer is finished while there are still blocked readers. Each reader will complete with this error.