public async Task MessagesCanBeHandledConcurrentlyAsync() { const int count = 10; var tasks = Enumerable .Range(0, count) .Select(i => { var messageNumber = i + 1; var message = GenerateMessage(); var detail = "Concurrent message (" + messageNumber + " of " + count + ")"; var @event = GenerateDiagnosticEvent(this, TestExecuted, message, detail); return(GelfLoggingSink.ConsumeAsync(@event)); }); await Task.WhenAll(tasks); }
protected Task WhenConsumingEvent() { return(GelfLoggingSink.ConsumeAsync(Event)); }