Inheritance: IPushMessages
Beispiel #1
0
        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();
        }
Beispiel #2
0
        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();
        }