public static IHystrixThreadPoolProperties GetThreadPoolProperties(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolPropertiesSetter setter) { if (threadPoolKey == null) { throw new ArgumentNullException("threadPoolKey"); } IHystrixPropertiesStrategy strategy = HystrixPlugins.Instance.PropertiesStrategy; string cacheKey = strategy.GetThreadPoolPropertiesCacheKey(threadPoolKey, setter); if (String.IsNullOrEmpty(cacheKey)) { return(strategy.GetThreadPoolProperties(threadPoolKey, setter)); } else { return(threadPoolProperties.GetOrAdd(cacheKey, w => { if (setter == null) { setter = new HystrixThreadPoolPropertiesSetter(); } return strategy.GetThreadPoolProperties(threadPoolKey, setter); })); } }
public MockingHystrixThreadPoolProperties(HystrixThreadPoolPropertiesSetter setter) { if (setter == null) { throw new ArgumentNullException("setter"); } this.setter = setter; }
public string GetThreadPoolPropertiesCacheKey(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolPropertiesSetter setter) { return(null); }
public IHystrixThreadPoolProperties GetThreadPoolProperties(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolPropertiesSetter setter) { if (setter == null) { setter = UnitTestSetterFactory.GetThreadPoolPropertiesSetter(); } return(new MockingHystrixThreadPoolProperties(setter)); }
public HystrixCommandSetter AndThreadPoolPropertiesDefaults(HystrixThreadPoolPropertiesSetter threadPoolPropertiesDefaults) { ThreadPoolPropertiesDefaults = threadPoolPropertiesDefaults; return(this); }
public virtual string GetThreadPoolPropertiesCacheKey(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolPropertiesSetter setter) { return(threadPoolKey.Name); }
public virtual IHystrixThreadPoolProperties GetThreadPoolProperties(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolPropertiesSetter setter) { return(new HystrixThreadPoolPropertiesDefault(setter)); }