Search in sources :

Example 1 with MDCCleanerThreadPoolExecutor

use of com.sequenceiq.cloudbreak.concurrent.MDCCleanerThreadPoolExecutor in project cloudbreak by hortonworks.

the class EventBusConfig method getEventBusDispatcher.

private Dispatcher getEventBusDispatcher() {
    ClassLoader context = new ClassLoader(Thread.currentThread().getContextClassLoader()) {
    };
    MDCCleanerThreadPoolExecutor executorService = new MDCCleanerThreadPoolExecutor(eventBusThreadPoolSize, eventBusThreadPoolSize, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(eventBusThreadPoolSize), new NamedDaemonThreadFactory("reactorDispatcher", context), (r, executor) -> r.run());
    return new ThreadPoolExecutorDispatcher(eventBusThreadPoolSize, eventBusThreadPoolSize, executorService);
}
Also used : MDCCleanerThreadPoolExecutor(com.sequenceiq.cloudbreak.concurrent.MDCCleanerThreadPoolExecutor) ThreadPoolExecutorDispatcher(reactor.core.dispatch.ThreadPoolExecutorDispatcher) NamedDaemonThreadFactory(reactor.core.support.NamedDaemonThreadFactory)

Aggregations

MDCCleanerThreadPoolExecutor (com.sequenceiq.cloudbreak.concurrent.MDCCleanerThreadPoolExecutor)1 ThreadPoolExecutorDispatcher (reactor.core.dispatch.ThreadPoolExecutorDispatcher)1 NamedDaemonThreadFactory (reactor.core.support.NamedDaemonThreadFactory)1