async Task HandleHostIncompingRequestReceivedAsync(IncomingRequestEventArgs e) { using (DependencyManager.ScopedResolver(Resolver)) { var context = new WriteTrackingResponseCommunicationContext(e.Context); context.PipelineData[Keys.Request.ResolverRequestScope] = Resolver.CreateRequestScope(); // register the required dependency in the web context SetupCommunicationContext(context); await _pipeline.RunAsync(context); } }
protected virtual void HandleHostIncomingRequestReceived(object sender, IncomingRequestEventArgs e) { Log.WriteDebug("Incoming host request for " + e.Context.Request.Uri); var task = CallWithDependencyResolver(async() => { // register the required dependency in the web context var context = e.Context; SetupCommunicationContext(context); await _pipeline.RunAsync(context); }); e.Context.PipelineData[Keys.Request.PipelineTask] = e.RunTask = task; }
protected virtual void HandleHostIncomingRequestReceived(object sender, IncomingRequestEventArgs e) { VerifyConfiguration(); Log.WriteDebug("Incoming host request for " + e.Context.Request.Uri); ThreadScopedAction(() => { // register the required dependency in the web context var context = e.Context; SetupCommunicationContext(context); Resolver.AddDependencyInstance <IHost>(Host, DependencyLifetime.PerRequest); Resolver.Resolve <IPipeline>().Run(context); }); }
protected virtual void HandleHostIncomingRequestReceived(object sender, IncomingRequestEventArgs e) { VerifyConfiguration(); Log.WriteDebug("Incoming host request for " + e.Context.Request.Uri); ThreadScopedAction(() => { // register the required dependency in the web context var context = e.Context; SetupCommunicationContext(context); Resolver.AddDependencyInstance <IHost>(Host, DependencyLifetime.PerRequest); var pipeline = Resolver.Resolve <IPipeline>(); var pipelineAsync = pipeline as IPipelineAsync; if (pipelineAsync != null) { context.PipelineData["openrasta.pipeline.completion"] = pipelineAsync.RunAsync(context); } else { pipeline.Run(context); } }); }
protected virtual void HandleHostIncomingRequestReceived(object sender, IncomingRequestEventArgs e) { VerifyConfiguration(); Log.WriteDebug("Incoming host request for " + e.Context.Request.Uri); ThreadScopedAction(() => { // register the required dependency in the web context var context = e.Context; SetupCommunicationContext(context); Resolver.AddDependencyInstance<IHost>(Host, DependencyLifetime.PerRequest); Resolver.Resolve<IPipeline>().Run(context); }); }
protected virtual void HandleHostIncomingRequestReceived(object sender, IncomingRequestEventArgs e) { VerifyConfiguration(); Log.WriteDebug("Incoming host request for " + e.Context.Request.Uri); ThreadScopedAction(() => { // register the required dependency in the web context var context = e.Context; SetupCommunicationContext(context); Resolver.AddDependencyInstance<IHost>(Host, DependencyLifetime.PerRequest); var pipeline = Resolver.Resolve<IPipeline>(); var pipelineAsync = pipeline as IPipelineAsync; if (pipelineAsync != null) context.PipelineData["openrasta.pipeline.completion"] = pipelineAsync.RunAsync(context); else pipeline.Run(context); }); }
protected virtual void HandleHostIncomingRequestReceived(object sender, IncomingRequestEventArgs e) { Log.WriteDebug("Incoming host request for " + e.Context.Request.Uri); e.Context.PipelineData[Keys.Request.PipelineTask] = e.RunTask = HandleHostIncompingRequestReceivedAsync(e); }