Namespace Neon.Tasks
Classes
Async
Task related utilities.
AsyncAutoResetEvent
Implements an async
/await
friendly equivalent of AutoResetEvent.
AsyncManualResetEvent
Implements an async
/await
friendly equivalent of ManualResetEvent.
AsyncMutex
Implements an async
/await
friendly equivalent of Mutex.
AsyncPeriodicTask
Implements a common asynchronous coding pattern where an asynchronous operation is performed periodically and cancellation and exceptions are handled cleanly.
AsyncReaderWriterLock
Implements an async
/await
friendly equivalent of ReaderWriterLock.
AsyncReentrantMutex
Extends AsyncMutex to support reentrancy.
AsyncTimer
Implements a timer that runs on a background Task.
Structs
NonDisposableTask
Used to convert a Task into an awaitable that that does not
implement IDisposable. This is useful for avoiding confusion
and hard to debug problems when async methods return an IDisposable
intended to be referenced in a using
statement. It is very easy to forget
the await
keyword in this situation and because Task
also implements IDisposable, there will be no compiler error
or warning. Wrapping the task with this structure addresses this.
NonDisposableTask<T>
Used to convert a Task<TResult> into an awaitable that that does not
implement IDisposable. This is useful for avoiding confusion
and hard to debug problems when async methods return an IDisposable
intended to be referenced in a using
statement. It is very easy to forget
the await
keyword in this situation and because Task<TResult>
also implements IDisposable, there will be no compiler error
or warning. Wrapping the task with this structure addresses this.
SyncContext
Used by public async
library methods to reset the current task
SynchronizationContext so that continuations won't be
marshalled back to the current thread which can cause serious problems
for UI apps.
Interfaces
IAsyncFuture
Defines an interface that completes a future operation asynchronously.
IAsyncFuture<T>
Defines an interface that returns the value from the asynchronous operation.
Enums
SyncContextMode
Enumerates the SyncContext modes, configured by setting Mode.