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