async Task Read() { try { lock (queues) { sourceIterator = source.Start(context); } while (await sourceIterator.MoveNext(cancel)) { try { await OnNext(sourceIterator.Current, cancel); } catch (OperationCanceledException) { } } } catch { if (sourceIterator != null) { sourceIterator.Cancel(); } throw; } }
public void Cancel() { cts.Cancel(); if (source != null) { source.Cancel(); } CancelInternal(); // cancel producer tasks }
protected override void CancelInternal() { lock (gate) { if (inner != null) { inner.Cancel(); } } }
async Task Read(IIterator <T> iterator, CancellationToken cancel) { try { while (await iterator.MoveNext(cancel).ConfigureAwait(false)) { await queue.OnNext(iterator.Current, cancel).ConfigureAwait(false); } } catch (Exception e) { queue.OnError(e); iterator.Cancel(); } }
async Task Read() { try { while (await SourceIterator.MoveNext(CancellationToken.None).ConfigureAwait(false)) { try { await Queue.OnNext(SourceIterator.Current, CancellationToken.None).ConfigureAwait(false); } catch (OperationCanceledException) { } } } catch { if (SourceIterator != null) { SourceIterator.Cancel(); } throw; } }
public void Cancel() { source.Cancel(); }
public void Cancel() { cts.Cancel(); source.Cancel(); }
public void Cancel() { firstIter?.Cancel(); secondIter?.Cancel(); }
public override void Cancel() { base.Cancel(); iterator1.Cancel(); iterator2.Cancel(); }