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


##########
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);
+                throw new WakeupException();
+            }
+            // Maybe Thread.sleep?

Review Comment:
   There must be a better way to do this than... sleep



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