public async Task Do() { var messages = new ConcurrentQueue<TransportMessage>(); messages.Enqueue(new TransportMessage()); messages.Enqueue(new TransportMessage()); messages.Enqueue(new TransportMessage()); var strategy = new PushMessages(messages, maxConcurrency: 1); await strategy.StartAsync(HandleMessage); await countdown.WaitAsync(); await strategy.StopAsync(); }
public async Task Do() { var messages = new ConcurrentQueue <TransportMessage>(); messages.Enqueue(new TransportMessage()); messages.Enqueue(new TransportMessage()); messages.Enqueue(new TransportMessage()); var strategy = new PushMessages(messages, maxConcurrency: 1); await strategy.StartAsync(HandleMessage); await countdown.WaitAsync(); await strategy.StopAsync(); }