takraj commented on code in PR #1163: URL: https://github.com/apache/plc4x/pull/1163#discussion_r1365367377
########## plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper.java: ########## @@ -231,19 +236,21 @@ public Duration getTimeout() { completionCallback.andThen(handler.getPacketConsumer()), handler.getOnTimeoutConsumer(), handler.getErrorConsumer(), + handler::confirmHandled, + handler::confirmError, + handler::cancel, handler.getTimeout() ); deferred.set(registration); registeredHandlers.add(registration); } private Consumer<TimeoutException> onTimeout(AtomicReference<HandlerRegistration> reference, Consumer<TimeoutException> onTimeoutConsumer) { - return new Consumer<TimeoutException>() { - @Override - public void accept(TimeoutException e) { - registeredHandlers.remove(reference.get()); - onTimeoutConsumer.accept(e); - } + return timeoutException -> { + final HandlerRegistration registration = reference.get(); Review Comment: OK, I wasn't aware of that. I'll change it back, and leave a comment. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@plc4x.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org