Пример #1
0
        Task InvokeTransport(IncomingTransportContext context, IBusForHandler bus, int currentIndex = 0)
        {
            if (currentIndex == registeredTransportPipeline.Count)
            {
                return(Task.CompletedTask);
            }

            IIncomingTransportStep step = registeredTransportPipeline[currentIndex];

            return(step.Invoke(context, bus, () => InvokeTransport(context, bus, currentIndex + 1)));
        }
Пример #2
0
        private Task InvokeTransport(IncomingTransportContext context, IBusForHandler bus)
        {
            if (this.executingTransportPipeline.Count == 0)
            {
                return(Task.FromResult(0));
            }

            IIncomingTransportStep step = this.executingTransportPipeline.Dequeue();

            return(step.Invoke(context, bus, () => this.InvokeTransport(context, bus)));
        }
Пример #3
0
        IIncomingTransportStepRegisterer IIncomingTransportStepRegisterer.Register(IIncomingTransportStep step)
        {
            registeredTransportPipeline.Enqueue(step);

            return this;
        }
Пример #4
0
        IIncomingTransportStepRegisterer IIncomingTransportStepRegisterer.Register(IIncomingTransportStep step)
        {
            registeredTransportPipeline.Add(step);

            return(this);
        }
Пример #5
0
        IIncomingTransportStepRegisterer IIncomingTransportStepRegisterer.Register(IIncomingTransportStep step)
        {
            this.registeredTransportPipeline.Enqueue(step);

            return(this);
        }