private Consumer<TimeoutException> onTimeout(AtomicReference<HandlerRegistration> reference, Consumer<TimeoutException> onTimeoutConsumer) {
        return timeoutException -> {
            final HandlerRegistration registration = reference.get();
            registeredHandlers.remove(registration);
            // Only call the timeout handler, if there is one.
            if(onTimeoutConsumer != null) {
                onTimeoutConsumer.accept(timeoutException);
            }
            registration.confirmError();
        };
    }
Performs registration of packet handler and makes sure that its timeout will be handled properly.
Since timeouts are controlled by {@link TimeoutManager} there is a need to decorate handler
operations so both sides know what's going on.

@param handler Handler to be registered.
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper.java