Inheritance: IPushMessages
コード例 #1
0
ファイル: Spec.cs プロジェクト: danielmarbach/async-dolls
        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();
        }
コード例 #2
0
ファイル: Spec.cs プロジェクト: sonbua/async-dolls
        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();
        }