private Task ProcessEventAsync(MockEventArgs arg) { Interlocked.Increment(ref _eventsProcessed[arg.Partition]); LastCompletionTime = _stopwatch.Elapsed; return(Task.CompletedTask); }
public MockEventProcessor(int partitions, int?maxEventsPerSecond, TimeSpan?errorAfter) { Partitions = partitions; MaxEventsPerSecond = maxEventsPerSecond; ErrorAfter = errorAfter; _eventArgs = new MockEventArgs[partitions]; for (var i = 0; i < partitions; i++) { _eventArgs[i] = new MockEventArgs(partition: i, data: "hello"); } _eventsRaised = new int[partitions]; }
private Task ProcessEventAsync(MockEventArgs arg) { EventRaised(); return(Task.CompletedTask); }