protected void PrintIterationInfo(string message)
 {
     if (OnIterationFinished != null)
     {
         OnIterationFinished.Invoke(message);
     }
 }
Beispiel #2
0
        private void ProcessItems()
        {
            Task.Run(async() =>
            {
                while (!_disposed)
                {
                    _resetEventSlim.Wait();
                    var emptyIteration = true;

                    while (!_disposed && TryDequeue(out var factoryFunc))
                    {
                        OnIterationStarted?.Invoke();
                        _pauseEventSlim.Wait();
                        await ExecuteCommand(factoryFunc);
                        emptyIteration = false;
                    }

                    _resetEventSlim.Reset();
                    Logger.WriteLine(GetType(), $"Iteration finished. Empty: {emptyIteration}");

                    if (!emptyIteration)
                    {
                        OnIterationFinished?.Invoke();
                    }
                }
            }, _cancellationTokenSource.Token);
        }
Beispiel #3
0
 protected void RaiseIterationFinishedEvent(IterationResult result)
 {
     OnIterationFinished?.Invoke(result);
 }