Skip to content

Commit

Permalink
rename hasNoTopicsSubscribed -> hasMoreData
Browse files Browse the repository at this point in the history
  • Loading branch information
VGalaxies committed Jun 14, 2024
1 parent c660717 commit 3a1371a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private static void dataSubscription3() throws Exception {
.buildPushConsumer()) {
consumer3.open();
consumer3.subscribe(TOPIC_3);
while (!consumer3.hasNoTopicsSubscribed()) {
while (!consumer3.hasMoreData()) {
LockSupport.parkNanos(SLEEP_NS); // wait some time
}
}
Expand Down Expand Up @@ -307,7 +307,7 @@ private static void dataSubscription4() throws Exception {
consumer4.subscribe(TOPIC_4);
while (true) {
LockSupport.parkNanos(SLEEP_NS); // wait some time
if (consumer4.hasNoTopicsSubscribed()) {
if (consumer4.hasMoreData()) {
break;
}
for (final SubscriptionMessage message : consumer4.poll(POLL_TIMEOUT_MS)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ public String getConsumerGroupId() {
return consumerGroupId;
}

public Set<String> getSubscribedTopicNames() {
return subscribedTopicNames;
}

public boolean hasNoTopicsSubscribed() {
/**
* @return When <b>only</b> subscribing to the query mode topics, if there is no new data to
* process, return {@code false}; otherwise, return {@code true}.
*/
public boolean hasMoreData() {
return subscribedTopicNames.isEmpty();
}

Expand Down

0 comments on commit 3a1371a

Please sign in to comment.