并发调用自托管ServiceStack服务

时间:2013-06-21 19:17:10

标签: servicestack

我的ServiceHost类继承自AppHostHttpListenerLongRunningBase,以便能够处理并发HTTP调用。但是,我的服务仍然以串行方式处理并发API调用。我的服务是在win32控制台应用程序中自托管的。我在这里想念的是什么?代码片断从初始化&配置功能如下。

 public ServicesHost() : base("MiTrendz Backend Services", 500, typeof(KeywordsManager).Assembly) { }
public override void Configure(Funq.Container container)
        {
            //Signal advanced web browsers what HTTP Methods you accept
            base.SetConfig(new EndpointHostConfig
            {
                GlobalResponseHeaders =
                {
                    { "Access-Control-Allow-Origin", "*" },
                    { "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS" },
                },
                WsdlServiceNamespace = "http://www.......",
                DebugMode = true,
            });
            container.Register(new MyService());


            container.Register<ICacheClient>(new MemoryCacheClient());
            Plugins.Add(new ValidationFeature());
            //This method scans the assembly for validators
            container.RegisterValidators(typeof(My Validator).Assembly);

        }

0 个答案:

没有答案