GetThreadPoolPropertiesSetter() public static method

public static GetThreadPoolPropertiesSetter ( ) : HystrixThreadPoolPropertiesSetter
return Elders.Hystrix.NET.ThreadPool.HystrixThreadPoolPropertiesSetter
コード例 #1
0
        public void ThreadPool_ShutdownWithWait()
        {
            // other unit tests will probably have run before this so get the count
            int count = HystrixThreadPoolFactory.ThreadPoolCount;

            IHystrixThreadPool pool = HystrixThreadPoolFactory.GetInstance("threadPoolFactoryTest",
                                                                           UnitTestSetterFactory.GetThreadPoolPropertiesSetter());

            Assert.AreEqual(count + 1, HystrixThreadPoolFactory.ThreadPoolCount);
            Assert.IsFalse(pool.Executor.IsShutdown);

            HystrixThreadPoolFactory.Shutdown(TimeSpan.FromSeconds(1.0));

            // ensure all pools were removed from the cache
            Assert.AreEqual(0, HystrixThreadPoolFactory.ThreadPoolCount);
            Assert.IsTrue(pool.Executor.IsShutdown);
        }