public AsyncReceiver(Consumer<K, V> consumer, int pollTimeoutMillis, String threadName, RecordHandler<K, V> recordHandler, ExceptionHandler exceptionHandler) { this.consumer = consumer; this.pollTimeoutMillis = pollTimeoutMillis; this.recordHandler = recordHandler; this.exceptionHandlerHandler = exceptionHandler; thread = WorkerThread.builder() .withOptions(new WorkerOptions().daemon().withName(threadName)) .onCycle(this::cycle) .onShutdown(this::shutdown) .buildAndStart(); }