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"); }
protected virtual void OnReplayChannelChanged(ReplayChannelEventArgs e) { EventHandler <ReplayChannelEventArgs> handler = ReplayChannelChanged; handler?.Invoke(this, e); }