Esempio n. 1
0
            public async Task Invoke(IncomingContext context, Func <Task> next)
            {
                using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                {
                    await Task.Delay(10).ConfigureAwait(false);

                    await next().ConfigureAwait(false);

                    scope.Complete();
                }
            }
Esempio n. 2
0
        Task InnerInvoke(IncomingContext context, int currentIndex = 0)
        {
            if (currentIndex == executingElements.Count)
            {
                return Task.CompletedTask;
            }

            ILinkElement element = executingElements[currentIndex];

            return element.Invoke(context, () => InnerInvoke(context, currentIndex + 1));
        }
Esempio n. 3
0
 public async Task Invoke(IncomingContext context, Func <Task> next)
 {
     try
     {
         await next();
     }
     catch (Exception e)
     {
         e.StackTrace.Output();
     }
     countdown.Signal();
 }
Esempio n. 4
0
 public Task Invoke(IncomingContext context)
 {
     return(InnerInvoke(context));
 }
Esempio n. 5
0
 public Task Invoke(IncomingContext context)
 {
     return InnerInvoke(context);
 }
Esempio n. 6
0
 public Task Invoke(IncomingContext context, Func<Task> next)
 {
     return next();
 }
Esempio n. 7
0
            public async Task Invoke(IncomingContext context, Func<Task> next)
            {
                await Task.Delay(10).ConfigureAwait(false);

                throw new InvalidOperationException(nameof(ThrowException));
            }
Esempio n. 8
0
 public async Task Invoke(IncomingContext context, Func<Task> next)
 {
     await Task.Delay(10).ConfigureAwait(false);
     await next().ConfigureAwait(false);
 }
Esempio n. 9
0
 static Task Connector(ChainFactory factory, TransportMessage message)
 {
     var pipeline = factory.Create();
     var context = new IncomingContext(message);
     return pipeline.Invoke(context);
 }
Esempio n. 10
0
 public async Task Invoke(IncomingContext context, Func<Task> next)
 {
     try
     {
         await next();
     }
     catch (Exception e)
     {
         e.StackTrace.Output();
     }
     countdown.Signal();
 }
Esempio n. 11
0
            public async Task Invoke(IncomingContext context, Func<Task> next)
            {
                using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
                {
                    await Task.Delay(10).ConfigureAwait(false);

                    await next().ConfigureAwait(false);

                    scope.Complete();
                }
            }
Esempio n. 12
0
            public async Task Invoke(IncomingContext context, Func <Task> next)
            {
                await Task.Delay(10).ConfigureAwait(false);

                throw new InvalidOperationException(nameof(ThrowException));
            }
Esempio n. 13
0
            public async Task Invoke(IncomingContext context, Func <Task> next)
            {
                await Task.Delay(10).ConfigureAwait(false);

                await next().ConfigureAwait(false);
            }
Esempio n. 14
0
 public Task Invoke(IncomingContext context, Func <Task> next)
 {
     return(next());
 }