예제 #1
0
        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);
            }
        }
예제 #2
0
        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;
        }
예제 #3
0
        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);
            });
        }
예제 #4
0
        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);
                }
            });
        }
예제 #5
0
        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);
            });
        }
예제 #6
0
    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);
      });
    }
예제 #7
0
 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);
 }