You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/12/01 03:08:55 UTC

[GitHub] [incubator-brpc] serverglen commented on a diff in pull request #2027: add timeout concurrency limiter

serverglen commented on code in PR #2027:
URL: https://github.com/apache/incubator-brpc/pull/2027#discussion_r1036648918


##########
src/brpc/concurrency_limiter.h:
##########
@@ -33,7 +33,7 @@ class ConcurrencyLimiter {
     // false when the concurrency reaches the upper limit, otherwise it 
     // returns true. Normally, when OnRequested returns false, you should 
     // return an ELIMIT error directly.
-    virtual bool OnRequested(int current_concurrency) = 0;
+    virtual bool OnRequested(int current_concurrency, int32_t timeout_ms) = 0;

Review Comment:
   个人觉得Controller*会好点,后面如果还需要实现其他限流策略,也可以复用Controller中的数据,也方便扩展。



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org