multitasking library

Classes

CancelableStreamFactory
A CancelableStreamFactory is a Stream factory that delegates stream creation to a function with a token parameter, which takes responsibility for creating a stream that will support cancellation of a subscription when cancellation is requested via a CancellationToken.
CancellationToken
A CancellationToken is a mechanism for cooperative cancellation of asynchronous operations.
CancellationTokenSource
A CancellationTokenSource class manages the cancellation process for asynchronous operations.
It works in conjunction with the CancellationToken class, providing a cooperative cancellation mechanism.
CancellationTransformer<T>
A CancellationTransformer is a stream transformer that allows to cancel a subscription using a cancellation token or a specified timeout, with support for non-blocking cancellation, and with support for sending a request to pause a stream and resume after a pause using a pause token.
PauseTransformer<T>
A PauseTransformer is a transformer that allows to pause/resume a stream subscription using a PauseToken.
Task<T>
A Task is an object representing some operation that will complete in the future.
Tasks are executed asynchronously and cooperatively.
Cooperative multitasking is a concurrency model where tasks voluntarily yield control (using await).
TaskCompletionSource<T>
A TaskCompletionSource is a producer of the tasks that can complete with a value, with an error, or in a canceled state.
TerminationTransformer<T>
A TerminationTransformer is a stream transformer that allows to define the termination handler onTerminate and the status handlers onCancel, onDone and onError.

Enums

TaskStatus
Represents the status of a task.

Extensions

StreamExtension on Stream<T>
A StreamExtension is an extension for Stream with various useful methods.

Typedefs

AnyTask = Task<Object?>
Type alias for a task of any type.

Exceptions / Errors

AggregateError
Represents an error that aggregates other errors amd exceptions and their stack traces.
CancellationException
Represents an exception used to indicate that the operation was canceled.
TaskStateError
Represents an error that occurs when an operation is requested on a Task whose current state does not allow the operation to be performed.