AnonHxy commented on code in PR #15789:
URL: https://github.com/apache/pulsar/pull/15789#discussion_r884084944
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -3066,6 +3036,19 @@ public void onUpdate(TopicPolicies policies) {
});
}
+ private CompletableFuture<Void> updateSubscriptionsDispatcherRateLimiter()
{
+ List<CompletableFuture<Void>> consumerCheckFutures = new ArrayList<>();
+ subscriptions.forEach((subName, sub) ->
sub.getConsumers().forEach(consumer -> {
+
consumerCheckFutures.add(consumer.checkPermissionsAsync().thenRun(() -> {
+ Dispatcher dispatcher = sub.getDispatcher();
+ if (dispatcher != null) {
+ dispatcher.updateRateLimiter();
+ }
+ }));
+ }));
+ return CompletableFuture.allOf(consumerCheckFutures.toArray(new
CompletableFuture[0]));
Review Comment:
They are same. `FutureUtil.waitForAll(consumerCheckFutures)` make less
modification for code. I will update it
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]