Exemple #1
0
        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();
        }
Exemple #2
0
        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 }));
        }
Exemple #4
0
 public Task Invoke(ILightflowContext context, int input, Func <int, Task> next)
 {
     return(next(input * 2));
 }