The Nito.AsyncEx library includes many types and extension methods. To avoid conflicts, all of these types are defined in the
Asynchronous Coordination Primitives
There is a whole suite of async
-ready coordination primitives. Cancellation is supported for all asynchronous operations that change state.
Most people just need
, but Nito.AsyncEx also includes
Asynchronous and Concurrent Collections
-ready producer/consumer queue that works on all platforms.
-compatible wrapper around IProducerConsumerCollection
, in the same way that
is a blocking wrapper around
You can also use
to send IProgress
updates to a producer/consumer collection.
Utility Types and Methods
class provides support for
asynchronous lazy initialization
You can use
to order tasks by when they complete.
class and the related
class provide contexts for asynchronous operations for situations where such a context is lacking (Console applications and Win32 services). Note that due to security restrictions,
AsyncContext and AsyncContextThread
will not work on Silverlight or Windows Phone platforms.
provides some static methods and constants for working with
simplifies the writing of "command-style" events that provide a
is a data-binding-friendly wrapper for a
, providing property-change notifications when the task completes.
is a non-generic version of the built-in
classes interoperate between Task-based Asynchronous Programming (async
) and the Asynchronous Programming Model (IAsyncResult
can also create wrapper tasks for most events.
, which helps interoperate between Task-based Asynchronous Programming (async
) and Event-based Asynchronous Programming (*Completed
provides static constant
values that are useful when taking advantage of the
async fast path
You can respond to task progress updates by using one of the implementations of
is available as a
will create a task that is canceled when a
has several extension methods for
, including propagating results from a completed Task
, and for completing the source forcing background continuations.
overloads to task factories.
There is currently only one Dataflow block in the library:
, which allows an async
function to provide data to a dataflow mesh with full cooperative cancellation and error propagation.
Low-Level Building Blocks
will preserve the stack trace when rethrowing any exception.
For dealing with SynchronizationContext
directly, the library provides
CurrentOrDefault and SynchronizationContextSwitcher