Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 384 Bytes

README.md

File metadata and controls

17 lines (16 loc) · 384 Bytes

TGD:三峡大坝(限流 Token Bucket)

Example

        RateLimiter limiter = RateLimiter.builder().
                withTokenPerSecond(1).
                withType(RateLimiter.RateLimiterType.TB).
                build();
        for ( int i = 0 ;i < 10;i++){
            limiter.getToken(1);
            //...
        }

限流策略