示例#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)));
        }
        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);
        }
        IIncomingTransportStepRegisterer IIncomingTransportStepRegisterer.Register(IIncomingTransportStep step)
        {
            this.registeredTransportPipeline.Enqueue(step);

            return(this);
        }