Ejemplo n.º 1
0
 private async Task Notify(CancellationToken token)
 {
     while (!token.IsCancellationRequested)
     {
         var channelEvent = new ReplayChannelEventArgs()
         {
             Threads       = Threads,
             producerCount = producerCount,
             decodeCount   = decodeCount,
             insertCount   = insertCount,
             StartTime     = StartTime,
             failedCount   = FailedReplays.Count
         };
         OnReplayChannelChanged(channelEvent);
         await Task.Delay(1000);
     }
     OnReplayChannelChanged(new ReplayChannelEventArgs()
     {
         Threads       = Threads,
         producerCount = producerCount,
         decodeCount   = decodeCount,
         insertCount   = insertCount,
         Done          = true,
         StartTime     = StartTime,
         failedCount   = FailedReplays.Count
     });
     logger.LogInformation($"notify canceled");
 }
Ejemplo n.º 2
0
        protected virtual void OnReplayChannelChanged(ReplayChannelEventArgs e)
        {
            EventHandler <ReplayChannelEventArgs> handler = ReplayChannelChanged;

            handler?.Invoke(this, e);
        }