接口 TokenService

所有已知子接口:
ClusterTokenClient, EmbeddedClusterTokenServer

public interface TokenService
Service interface of flow control.
从以下版本开始:
1.4.0
作者:
Eric Zhao
  • 方法详细资料

    • requestToken

      TokenResult requestToken(Long ruleId, int acquireCount, boolean prioritized)
      Request tokens from remote token server.
      参数:
      ruleId - the unique rule ID
      acquireCount - token count to acquire
      prioritized - whether the request is prioritized
      返回:
      result of the token request
    • requestParamToken

      TokenResult requestParamToken(Long ruleId, int acquireCount, Collection<Object> params)
      Request tokens for a specific parameter from remote token server.
      参数:
      ruleId - the unique rule ID
      acquireCount - token count to acquire
      params - parameter list
      返回:
      result of the token request
    • requestConcurrentToken

      TokenResult requestConcurrentToken(String clientAddress, Long ruleId, int acquireCount)
      Request acquire concurrent tokens from remote token server.
      参数:
      clientAddress - the address of the request belong.
      ruleId - ruleId the unique rule ID
      acquireCount - token count to acquire
      返回:
      result of the token request
    • releaseConcurrentToken

      void releaseConcurrentToken(Long tokenId)
      Request release concurrent tokens from remote token server asynchronously.
      参数:
      tokenId - the unique token ID