//processing methods protected virtual void DequeueAll() { while (CanContinue()) { SignalWrapper <SignalDispatch <TKey> > item = _dispatchQueue.DequeueNext(); if (item == null) { break; } StartNextTask(() => ProcessSignal(item)); } WaitForCompletion(); }