lianetm commented on code in PR #15640:
URL: https://github.com/apache/kafka/pull/15640#discussion_r1608516652


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -1848,6 +1821,40 @@ private void subscribeInternal(Collection<String> 
topics, Optional<ConsumerRebal
         }
     }
 
+    /**
+     * Process the events—if any—that were produced by the {@link 
ConsumerNetworkThread network thread}.
+     * It is possible that {@link ErrorEvent an error}
+     * could occur when processing the events. In such cases, the processor 
will take a reference to the first
+     * error, continue to process the remaining events, and then throw the 
first error that occurred.
+     */
+    private boolean processBackgroundEvents(EventProcessor<BackgroundEvent> 
processor) {

Review Comment:
   This `processor` passed as argument is in the end always a reference to the 
`backgroundEventProcessor`, so  could we simplify this, remove the arg and 
directly reference the var? It caught my attention when seeing how this is 
used, which seems a bit redundant with all calls having to provide the same 
`processBackgroundEvents(backgroundEventProcessor, ...` which feels like an 
internal that the `processBackgroundEvents` could know about.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to