Click or drag to resize

Neon.Tasks Namespace

This namespace includes a handful of types that implement the async equivalent of primitives like auto/manual reset events, mutexes, reader/writer locks, and timers. This also includes SyncContext which can be used to easily clear the synchronization context within API implementations.
Classes
  ClassDescription
Public classAsyncAutoResetEvent
Implements an async/await friendly equivalent of AutoResetEvent.
Public classAsyncManualResetEvent
Implements an async/await friendly equivalent of ManualResetEvent.
Public classAsyncMutex
Implements an async/await friendly equivalent of Mutex.
Public classAsyncPeriodicTask
Implements a common asynchronous coding pattern where an asynchronous operation is performed periodically and cancellation and exceptions are handled cleanly.
Public classAsyncReaderWriterLock
Implements an async/await friendly equivalent of ReaderWriterLock.
Structures
  StructureDescription
Public structureNonDisposableTask
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.
Public structureNonDisposableTaskT
Used to convert a TaskTResult 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 TaskTResult also implements IDisposable, there will be no compiler error or warning. Wrapping the task with this structure addresses this.
Public structureSyncContext
Used by public async library methods to reset the current task SynchronizationContext so that continuations won't be marshalled back to the current thread, improving performance.
Interfaces
  InterfaceDescription
Public interfaceIAsyncFuture
Defines an interface that completes a future operation asynchronously.
Public interfaceIAsyncFutureT
Defines an interface that returns the value from the asynchronous operation.