async_tools library

Async Tools

Classes

AsyncData<T>
AsyncError<T>
AsyncLoading<T>
AsyncTagLock<T>
AsyncValue<T>
An utility for safely manipulating asynchronous data.
CancelRequest
CancelValueRequest<T>
DelayedWaitSet<T, C>
Execute a set of async closures (functions returninga Future) in batches.
Mutex
Mutual exclusion.
ReadWriteMutex
Mutual exclusion that supports read and write locks.
SingleStatelessProcessor
Process a single stateless update at a time ensuring each request gets processed asynchronously, and continuously while update is requested.
SingleStateProcessor<State>
Process a single state update at a time ensuring the most recent state gets processed asynchronously, possibly skipping states that happen while a previous state is still being processed.
SingleStateProcessorMap<Key, State>
A map-like data structure that manages continuous single-state updates for a set of keys.
WaitSet<T, C>
Execute a set of async closures (functions returning a Future) immediately but wait until they all finish. Closures are immediately executed upon calling 'add'.

Extensions

FutureCancellableExt on Future<T>

Functions

asyncSleep([Duration? duration]) Future<void>
Sleep asynchronously for a specified duration, or 1 second if not specified
serialFuture<T>(Object tag, Future<T> closure(), {void onDone(T)?, void onError(Object e, StackTrace? st)?}) → void
Process a single future at a time per tag queued serially
serialFutureClose(Object tag) Future<void>
serialFuturePause(Object tag) Future<void>
serialFutureResume(Object tag) → void
singleFuture<T>(Object tag, Future<T> closure(), {void onBusy()?, void onDone(T)?, void onError(Object e, StackTrace? st)?}) → void
Process a single future at a time per tag
singleFuturePause(Object tag) Future<void>
singleFutureResume(Object tag) → void

Typedefs

SerialFutureQueueItem = Future<void> Function()

Exceptions / Errors

CancelException