public async Task Invoke(ILightflowContext context, T input, Func <T, Task> next) { while (!this.channel.Writer.TryWrite(() => next(input))) { await this.channel.Writer .WaitToWriteAsync() .ConfigureAwait(false); } this.EnsureEventLoopIsRunning(); }
public async Task Invoke(ILightflowContext context, T input, Func <T, Task> next) { await this.semaphore.WaitAsync().ConfigureAwait(false); try { await next(input).ConfigureAwait(false); } finally { this.semaphore.Release(); } }
public Task InvokeStep(ILightflowContext context, object input, Delegate next) { var step = this.GetStepinstance(); return((Task)this.InvokeMethod.Invoke(step, new[] { context, input, next })); }
public Task Invoke(ILightflowContext context, int input, Func <int, Task> next) { return(next(input * 2)); }