This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AwaitableQueue<T> | |
{ | |
private readonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>(); | |
private long _count = 0; | |
private readonly ConcurrentQueue<TaskCompletionSource<T>> _pending = new ConcurrentQueue<TaskCompletionSource<T>>(); | |
/// <summary> | |
/// Enqueue the specified item. Blocking operation. | |
/// </summary> | |
/// <param name="item">Item.</param> |