Esempio n. 1
0
 private async Task RunReportProgress(ProcessingQueueItem <TItem, TResult> item, CancellationTokenSource internalCancellationTokenSource)
 {
     try
     {
         if (!internalCancellationTokenSource.IsCancellationRequested)
         {
             await ReportProgress(item);
         }
     }
     catch { }
 }
Esempio n. 2
0
        private async Task <bool> RunProcessItem(ProcessingQueueItem <TItem, TResult> item, CancellationTokenSource internalCancellationTokenSource)
        {
            item.Processed = true;
            try
            {
                item.Output = await ProcessItem(item.Input);

                return(true);
            }
            catch (Exception exc)
            {
                item.Exception = exc;
                if (StopOnFirstException)
                {
                    if (!internalCancellationTokenSource.IsCancellationRequested)
                    {
                        internalCancellationTokenSource.Cancel();
                    }
                    return(false);
                }
                return(true);
            }
        }
Esempio n. 3
0
 public abstract Task ReportProgress(ProcessingQueueItem <TItem, TResult> item);