Browse Source

MINOR: Add description of how consumer wakeup acts if no threads are awakened

I think the Javadoc should describe what happens if wakeup is called and no other thread is currently blocking. This may be important in some cases, e.g. trying to shut down a poll thread, followed by manually committing offsets.

Author: Stig Rohde Døssing <sdo@it-minds.dk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #2093 from srdo/minor-expand-wakeup-javadoc
pull/2105/head
Stig Rohde Døssing 8 years ago committed by Jason Gustafson
parent
commit
5e7190cf83
  1. 1
      clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java

1
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java

@ -1475,6 +1475,7 @@ public class KafkaConsumer<K, V> implements Consumer<K, V> { @@ -1475,6 +1475,7 @@ public class KafkaConsumer<K, V> implements Consumer<K, V> {
/**
* Wakeup the consumer. This method is thread-safe and is useful in particular to abort a long poll.
* The thread which is blocking in an operation will throw {@link org.apache.kafka.common.errors.WakeupException}.
* If no thread is blocking in a method which can throw {@link org.apache.kafka.common.errors.WakeupException}, the next call to such a method will raise it instead.
*/
@Override
public void wakeup() {

Loading…
Cancel
Save