@SuppressWarnings("unchecked") public HashedTimingWheel(int corePoolSize) { ROTATION_TIME=wheel_size * tick_time; wheel=(List<MyTask>[])new List[wheel_size]; pool=new ThreadPoolExecutor(corePoolSize, corePoolSize * 2, 5000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(5000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
@SuppressWarnings("unchecked") public HashedTimingWheel(ThreadFactory factory, int min_threads, int max_threads, long keep_alive_time, int max_queue_size, int wheel_size, long tick_time) { this.wheel_size=wheel_size; this.tick_time=tick_time; ROTATION_TIME=wheel_size * tick_time; wheel=new List[this.wheel_size]; timer_thread_factory=factory; pool=new ThreadPoolExecutor(min_threads, max_threads,keep_alive_time, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(max_queue_size), factory, new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
/** * Create a scheduler that executes tasks in dynamically adjustable intervals */ @SuppressWarnings("unchecked") public HashedTimingWheel() { ROTATION_TIME=wheel_size * tick_time; wheel=new List[wheel_size]; pool=new ThreadPoolExecutor(4, 10, 5000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(5000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
/** * Create a scheduler that executes tasks in dynamically adjustable intervals */ @SuppressWarnings("unchecked") public HashedTimingWheel() { ROTATION_TIME=wheel_size * tick_time; wheel=new List[wheel_size]; pool=new ThreadPoolExecutor(4, 10, 5000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(5000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
@SuppressWarnings("unchecked") public HashedTimingWheel(int corePoolSize) { ROTATION_TIME=wheel_size * tick_time; wheel=(List<MyTask>[])new List[wheel_size]; pool=new ThreadPoolExecutor(corePoolSize, corePoolSize * 2, 5000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(5000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
@SuppressWarnings("unchecked") public HashedTimingWheel(int corePoolSize) { ROTATION_TIME=wheel_size * tick_time; wheel=(List<MyTask>[])new List[wheel_size]; pool=new ThreadPoolExecutor(corePoolSize, corePoolSize * 2, 5000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(5000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
@SuppressWarnings("unchecked") public HashedTimingWheel(ThreadFactory factory, int min_threads, int max_threads, long keep_alive_time, int max_queue_size, int wheel_size, long tick_time) { this.wheel_size=wheel_size; this.tick_time=tick_time; ROTATION_TIME=wheel_size * tick_time; wheel=new List[this.wheel_size]; timer_thread_factory=factory; pool=new ThreadPoolExecutor(min_threads, max_threads,keep_alive_time, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(max_queue_size), factory, new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
@SuppressWarnings("unchecked") public HashedTimingWheel(ThreadFactory factory, int min_threads, int max_threads, long keep_alive_time, int max_queue_size, int wheel_size, long tick_time) { this.wheel_size=wheel_size; this.tick_time=tick_time; ROTATION_TIME=wheel_size * tick_time; wheel=new List[this.wheel_size]; timer_thread_factory=factory; pool=new ThreadPoolExecutor(min_threads, max_threads,keep_alive_time, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(max_queue_size), factory, new ThreadPoolExecutor.CallerRunsPolicy()); init(); }
/** * Create a scheduler that executes tasks in dynamically adjustable intervals */ @SuppressWarnings("unchecked") public HashedTimingWheel() { ROTATION_TIME=wheel_size * tick_time; wheel=new List[wheel_size]; pool=new ThreadPoolExecutor(4, 10, 5000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(5000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); init(); }