Nito.AsyncEx.IAsyncWaitQueue<T>
A collection of cancelable TaskCompletionSource<T> instances. Implementations must assume the caller is holding a lock.
namespace Nito.AsyncEx
{
public interface IAsyncWaitQueue<T>
{
bool IsEmpty { get; }
Task<T> Enqueue();
void Dequeue(T result = default(T));
void DequeueAll(T result = default(T));
bool TryCancel(Task task, CancellationToken cancellationToken);
void CancelAll(CancellationToken cancellationToken);
}
}