接口 TokenService
- 所有已知子接口:
ClusterTokenClient,EmbeddedClusterTokenServer
public interface TokenService
Service interface of flow control.
- 从以下版本开始:
- 1.4.0
- 作者:
- Eric Zhao
-
方法概要
修饰符和类型方法说明voidreleaseConcurrentToken(Long tokenId) Request release concurrent tokens from remote token server asynchronously.requestConcurrentToken(String clientAddress, Long ruleId, int acquireCount) Request acquire concurrent tokens from remote token server.requestParamToken(Long ruleId, int acquireCount, Collection<Object> params) Request tokens for a specific parameter from remote token server.requestToken(Long ruleId, int acquireCount, boolean prioritized) Request tokens from remote token server.
-
方法详细资料
-
requestToken
Request tokens from remote token server.- 参数:
ruleId- the unique rule IDacquireCount- token count to acquireprioritized- whether the request is prioritized- 返回:
- result of the token request
-
requestParamToken
Request tokens for a specific parameter from remote token server.- 参数:
ruleId- the unique rule IDacquireCount- token count to acquireparams- parameter list- 返回:
- result of the token request
-
requestConcurrentToken
Request acquire concurrent tokens from remote token server.- 参数:
clientAddress- the address of the request belong.ruleId- ruleId the unique rule IDacquireCount- token count to acquire- 返回:
- result of the token request
-
releaseConcurrentToken
Request release concurrent tokens from remote token server asynchronously.- 参数:
tokenId- the unique token ID
-