public static IHystrixCollapserOptions GetCollapserOptions(IHystrixCollapserKey key, IHystrixCollapserOptions builder) { HystrixOptionsStrategy hystrixPropertiesStrategy = HystrixPlugins.OptionsStrategy; string cacheKey = hystrixPropertiesStrategy.GetCollapserOptionsCacheKey(key, builder); if (cacheKey != null) { return collapserProperties.GetOrAddEx(cacheKey, (k) => hystrixPropertiesStrategy.GetCollapserOptions(key, builder)); } else { // no cacheKey so we generate it with caching return hystrixPropertiesStrategy.GetCollapserOptions(key, builder); } }
public static IHystrixThreadPoolOptions GetThreadPoolOptions(IHystrixThreadPoolKey key, IHystrixThreadPoolOptions builder) { HystrixOptionsStrategy hystrixPropertiesStrategy = HystrixPlugins.OptionsStrategy; string cacheKey = hystrixPropertiesStrategy.GetThreadPoolOptionsCacheKey(key, builder); if (cacheKey != null) { return(threadPoolProperties.GetOrAddEx(cacheKey, (k) => hystrixPropertiesStrategy.GetThreadPoolOptions(key, builder))); } else { // no cacheKey so we generate it with caching return(hystrixPropertiesStrategy.GetThreadPoolOptions(key, builder)); } }