protected override void SpoolingWork() { TInputOutput currentElement = default(TInputOutput); TIgnoreKey currentKey = default(TIgnoreKey); QueryOperatorEnumerator <TInputOutput, TIgnoreKey> source = this.m_source; SynchronousChannel <TInputOutput> destination = this.m_destination; CancellationToken mergedCancellationToken = base.m_groupState.CancellationState.MergedCancellationToken; destination.Init(); while (source.MoveNext(ref currentElement, ref currentKey)) { if (mergedCancellationToken.IsCancellationRequested) { return; } destination.Enqueue(currentElement); } }
//----------------------------------------------------------------------------------- // This method is responsible for enumerating results and enqueueing them to // the output channel(s) as appropriate. Each base class implements its own. // protected override void SpoolingWork() { // We just enumerate over the entire source data stream, placing each element // into the destination channel. TInputOutput current = default(TInputOutput); TIgnoreKey keyUnused = default(TIgnoreKey); QueryOperatorEnumerator <TInputOutput, TIgnoreKey> source = _source; SynchronousChannel <TInputOutput> destination = _destination; CancellationToken cancelToken = _groupState.CancellationState.MergedCancellationToken; destination.Init(); while (source.MoveNext(ref current, ref keyUnused)) { // If an abort has been requested, stop this worker immediately. if (cancelToken.IsCancellationRequested) { break; } destination.Enqueue(current); } }