#397·disruptor

Why does `TimeoutHandler` get to throw `Exception`?

Author: PalmrCreated Oct 13, 2021Updated Sep 29, 2023

TimeoutHandler::onTimeout throws a checked exception if the implementation is unable to handle the timeout.

BatchEventProcessor::notifyTimeout catches Throwable, so no need for checked exception type.

The exception gets passed to the exception handler which may handle or bail out of the BatchEventProcessor::processEvents depending on the ExceptionHandler implementation.

This is leaning towards use of exceptions for control flow and perhaps we could look at returning something useful from TimeoutHandler::onTimeout instead?