Пример #1
0
        public async Task Do()
        {
            var messages = new ConcurrentQueue<TransportMessage>();
            messages.Enqueue(new TransportMessage());
            messages.Enqueue(new TransportMessage());
            messages.Enqueue(new TransportMessage());

            var countdown = new AsyncCountdownEvent(3);

            var pipelineFactory = new IncomingPipelineFactory();
            pipelineFactory.Register(() => new DelayStep());
            pipelineFactory.Register(() => new LogStep());
            pipelineFactory.Register(() => new DecrementStep(countdown));

            var strategy = new DequeueStrategy(messages, maxConcurrency: 1);
            await strategy.StartAsync(tm => Connector(pipelineFactory, tm));

            await countdown.WaitAsync();

            await strategy.StopAsync();
        }
Пример #2
0
 public DebugView(AsyncCountdownEvent ce)
 {
     _ce = ce;
 }
Пример #3
0
 public DecrementStep(AsyncCountdownEvent countdown)
 {
     this.countdown = countdown;
 }