async Task <bool> InvokeUntil <T>(params IPipelineMiddlewareFactory[] factories) { Operation = factories.Compose().Invoke(Env); return(await Yielding.DidItYield( Operation, Env.Yielder(typeof(T).Name).Task)); }
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); } }