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;
                }
            }
Exemple #2
0
 public void Cancel()
 {
     cts.Cancel();
     if (source != null)
     {
         source.Cancel();
     }
     CancelInternal();       // cancel producer tasks
 }
Exemple #3
0
 protected override void CancelInternal()
 {
     lock (gate)
     {
         if (inner != null)
         {
             inner.Cancel();
         }
     }
 }
Exemple #4
0
 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();
     }
 }
Exemple #5
0
 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;
     }
 }
Exemple #6
0
 public void Cancel()
 {
     source.Cancel();
 }
Exemple #7
0
 public void Cancel()
 {
     cts.Cancel();
     source.Cancel();
 }
Exemple #8
0
 public void Cancel()
 {
     firstIter?.Cancel();
     secondIter?.Cancel();
 }
 public override void Cancel()
 {
     base.Cancel();
     iterator1.Cancel();
     iterator2.Cancel();
 }