[bisq-network/bisq] Prevent excessive api calls (#4966)

sqrrm notifications at github.com
Wed Dec 23 13:11:11 CET 2020


@sqrrm requested changes on this pull request.

Functionality now looks right. Just some comments on naming.

>  
-    @Nullable
-    private Timer timer;
+    private transient final ArrayDeque<Long> callTimestamps;
 
     public GrpcCallRateMeter(int allowedCallsPerTimeUnit, TimeUnit timeUnit) {

`allowedCallsPerTimeUnit` is a bit misleading as it's really allowedCallsPerTimeWindow.

>      }
 
-    public void incrementCallsCount() {
-        callsCount++;
+    public boolean isAllowed() {

`isAllowed()` indicates it's just checking if something is allowed, this method i changing the state of the class. I would prefer something `call(successCallback, failCallback)` or `checkAndIncrement()`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4966#pullrequestreview-557827065
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201223/ff0a8400/attachment.htm>


More information about the bisq-github mailing list