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);
            }
        }
Exemple #2
0
 async Task Resume <T>()
 {
     Env.Resumer(typeof(T).Name).SetResult(true);
     await Operation;
 }