Nito.AsyncEx.Context Provides a context for asynchronous operations. This class is threadsafe. may only be called once. After returns, the async context should be disposed. The queue holding the actions to run. The for this . The for this . The for this . The number of outstanding operations, including actions in the queue. Initializes a new instance of the class. This is an advanced operation; most people should use one of the static Run methods instead. Gets a semi-unique identifier for this asynchronous context. This is the same identifier as the context's . Increments the outstanding asynchronous operation count. Decrements the outstanding asynchronous operation count. Queues a task for execution by . If all tasks have been completed and the outstanding asynchronous operation count is zero, then this method has undefined behavior. The task to queue. May not be null. A value indicating whether exceptions on this task should be propagated out of the main loop. Disposes all resources used by this class. This method should NOT be called while is executing. Executes all queued actions. This method returns when all tasks have been completed and the outstanding asynchronous operation count is zero. This method will unwrap and propagate errors from tasks that are supposed to propagate errors. Queues a task for execution, and begins executing all tasks in the queue. This method returns when all tasks have been completed and the outstanding asynchronous operation count is zero. This method will unwrap and propagate errors from the task. The action to execute. May not be null. Queues a task for execution, and begins executing all tasks in the queue. This method returns when all tasks have been completed and the outstanding asynchronous operation count is zero. Returns the result of the task. This method will unwrap and propagate errors from the task. The result type of the task. The action to execute. May not be null. Queues a task for execution, and begins executing all tasks in the queue. This method returns when all tasks have been completed and the outstanding asynchronous operation count is zero. This method will unwrap and propagate errors from the task proxy. The action to execute. May not be null. Queues a task for execution, and begins executing all tasks in the queue. This method returns when all tasks have been completed and the outstanding asynchronous operation count is zero. Returns the result of the task proxy. This method will unwrap and propagate errors from the task proxy. The result type of the task. The action to execute. May not be null. Gets the current for this thread, or null if this thread is not currently running in an . Gets the for this . From inside , this value is always equal to . Gets the for this . From inside , this value is always equal to . Gets the for this . Note that this factory has the option set. Be careful with async delegates; you may need to call and to prevent early termination of this . The implementation used by . The async context. Initializes a new instance of the class. The async context. Gets the async context. Dispatches an asynchronous message to the async context. If all tasks have been completed and the outstanding asynchronous operation count is zero, then this method has undefined behavior. The delegate to call. May not be null. The object passed to the delegate. Dispatches an asynchronous message to the async context, and waits for it to complete. The delegate to call. May not be null. The object passed to the delegate. Responds to the notification that an operation has started by incrementing the outstanding asynchronous operation count. Responds to the notification that an operation has completed by decrementing the outstanding asynchronous operation count. Creates a copy of the synchronization context. A new object. Returns a hash code for this instance. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. Determines whether the specified is equal to this instance. It is considered equal if it refers to the same underlying async context as this instance. The to compare with this instance. true if the specified is equal to this instance; otherwise, false. A blocking queue. The underlying blocking collection. Initializes a new instance of the class. Gets a blocking enumerable that removes items from the queue. This enumerable only completes after has been called. A blocking enumerable that removes items from the queue. Generates an enumerable of instances currently queued to the scheduler waiting to be executed. An enumerable that allows traversal of tasks currently queued to this scheduler. Attempts to add the item to the queue. If the queue has been marked as complete for adding, this method returns false. The item to enqueue. A value indicating whether exceptions on this task should be propagated out of the main loop. Marks the queue as complete for adding, allowing the enumerator returned from to eventually complete. This method may be called several times. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. A task scheduler which schedules tasks to an async context. The async context for this task scheduler. Initializes a new instance of the class. The async context for this task scheduler. May not be null. Generates an enumerable of instances currently queued to the scheduler waiting to be executed. An enumerable that allows traversal of tasks currently queued to this scheduler. Queues a to the scheduler. If all tasks have been completed and the outstanding asynchronous operation count is zero, then this method has undefined behavior. The to be queued. Determines whether the provided can be executed synchronously in this call, and if it can, executes it. The to be executed. A Boolean denoting whether or not task has previously been queued. If this parameter is True, then the task may have been previously queued (scheduled); if False, then the task is known not to have been queued, and this call is being made in order to execute the task inline without queuing it. A Boolean value indicating whether the task was executed inline. The was already executed. Indicates the maximum concurrency level this is able to support. Exposes the base method. The task to attempt to execute. A thread that executes actions within an . The child thread. Creates a new and increments its operation count. Initializes a new instance of the class, creating a child thread waiting for commands. The context for this thread. Initializes a new instance of the class, creating a child thread waiting for commands. Gets the executed by this thread. Permits the thread to exit, if we have not already done so. Requests the thread to exit and returns a task representing the exit of the thread. The thread will exit when all outstanding asynchronous operations complete. Requests the thread to exit and blocks until the thread exits. The thread will exit when all outstanding asynchronous operations complete. Requests the thread to exit. Gets the for this thread, which can be used to schedule work to this thread.