public QueuePorterWorkingContext(ThreadSafeQueue <T> queue, QueueDataAvailableEventHandler <T> handler, int outstandingWorkersLimitHint) { if (queue == null) { throw new ArgumentNullException("queue"); } if (handler == null) { throw new ArgumentNullException("handler"); } if (1 > outstandingWorkersLimitHint) { throw new ArgumentOutOfRangeException("outstandingWorkersLimitHint"); } this.Queue = queue; this.QueueDataAvailableEventHandler = handler; this.OutstandingWorkersLimitHint = outstandingWorkersLimitHint; }
public QueuePorter(ThreadSafeQueue <T> queue, QueueDataAvailableEventHandler <T> dataAvailableEventHandler, bool allowToHandleErrors) : this(new QueuePorterWorkingContext <T>[] { new QueuePorterWorkingContext <T>(queue, dataAvailableEventHandler, 1) }, allowToHandleErrors) { }