public static bool SupportsProducerQueue(this ThreadQueueMode thisValue) { switch (thisValue) { case ThreadQueueMode.Task: case ThreadQueueMode.WaitAndPulse: case ThreadQueueMode.Event: case ThreadQueueMode.TaskGroup: case ThreadQueueMode.SemaphoreSlim: case ThreadQueueMode.Semaphore: case ThreadQueueMode.Mutex: case ThreadQueueMode.ThresholdTaskGroup: return(true); default: return(false); } }
/// <inheritdoc /> public SynchronizedProducerQueue(ThreadQueueMode mode, [NotNull] ProducerConsumerQueueOptions <T> options, CancellationToken token = default(CancellationToken)) { _queue = ProducerConsumerQueue.Create(mode, options, token); _producerQueue = _queue as IProducerQueue <TQueue, T> ?? throw new NotSupportedException(); }