コード例 #1
0
        async Task <bool> InvokeUntil <T>(params IPipelineMiddlewareFactory[] factories)
        {
            Operation = factories.Compose().Invoke(Env);

            return(await Yielding.DidItYield(
                       Operation,
                       Env.Yielder(typeof(T).Name).Task));
        }
コード例 #2
0
        public async Task Invoke(ICommunicationContext env)
        {
            env.Yielder(_yieldName).SetResult(true);

            var currentContext = HttpContext.Current;
            var shouldContinue = await env.Resumer(_yieldName).Task;

            if (HttpContext.Current == null)
            {
                HttpContext.Current = currentContext;
            }
            if (shouldContinue)
            {
                await Next.Invoke(env);
            }
        }