Esempio n. 1
0
 public int ComputeWps(Config config)
 {
     return(ThreadPoolConfig.ScaledPoolSize(
                config.GetInt("pool-size-min"),
                config.GetDouble("pool-size-factor"),
                config.GetInt("pool-size-max")));
 }
        private static int ComputeWorkerPoolSize(Config config)
        {
            if (config == null) return ThreadPoolConfig.ScaledPoolSize(2, 1.0, 2);

            return ThreadPoolConfig.ScaledPoolSize(
                floor: config.GetInt("pool-size-min"),
                scalar: config.GetDouble("pool-size-factor"),
                ceiling: config.GetInt("pool-size-max"));
        }
Esempio n. 3
0
        public int ComputeWps(Config config)
        {
            if (config.IsNullOrEmpty())
            {
                return(ThreadPoolConfig.ScaledPoolSize(2, 1.0, 2));
            }

            return(ThreadPoolConfig.ScaledPoolSize(
                       config.GetInt("pool-size-min", 0),
                       config.GetDouble("pool-size-factor", 0),
                       config.GetInt("pool-size-max", 0)));
        }
        private static int ComputeWorkerPoolSize(Config config)
        {
            if (config.IsNullOrEmpty())
            {
                return(ThreadPoolConfig.ScaledPoolSize(2, 1.0, 2));
            }

            return(ThreadPoolConfig.ScaledPoolSize(
                       floor: config.GetInt("pool-size-min", 0),
                       scalar: config.GetDouble("pool-size-factor", 0),
                       ceiling: config.GetInt("pool-size-max", 0)));
        }