lhotari commented on pull request #10831:
URL: https://github.com/apache/pulsar/pull/10831#issuecomment-855198391


   > @lhotari - in order to call `get` on the atomic wrapper just once, what if 
we added a new method that returns an `Optional<Integer>` that is a combination 
of the `isConsumerAvailable` and the `getAvailablePermits` methods? It would 
introduce additional overhead for the new objects, so perhaps it's an 
unnecessary change. Do you have a preference?
   
   In this part of code I believe that there's a goal of zero allocations since 
this is part of a hot code path. Therefore, omitting the usage of Optional is 
also desired.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to