Hangleton commented on code in PR #13490:
URL: https://github.com/apache/kafka/pull/13490#discussion_r1157169425


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumer.java:
##########
@@ -546,6 +543,26 @@ public ConsumerRecords<K, V> poll(long timeout) {
         throw new KafkaException("method not implemented");
     }
 
+    <T> T tryGetFutureResult(
+            final Time time,
+            final WakeupableFuture<T> future,
+            final Duration timeout) throws ExecutionException, 
InterruptedException {
+        Timer timer = time.timer(timeout.toMillis());
+        do {
+            if (future.isDone()) {
+                return future.get();
+            }
+
+            if (this.shouldWakeup.get()) {
+                this.shouldWakeup.set(false);
+                future.cancel(true);

Review Comment:
   Should `WakeupableFuture#wakeup` be used here? 



-- 
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