@Override protected void doStart() { // A single thread executor for all events ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), Threads.createDaemonThreadFactory("zk-client-EventThread")); // Just discard the execution if the executor is closed executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy()); eventExecutor = executor; try { zooKeeper.set(createZooKeeper()); } catch (IOException e) { notifyFailed(e); } }
@Override protected void doStart() { // A single thread executor for all events ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), Threads.createDaemonThreadFactory("zk-client-EventThread")); // Just discard the execution if the executor is closed executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy()); eventExecutor = executor; try { zooKeeper.set(createZooKeeper()); } catch (IOException e) { notifyFailed(e); } }