Helius
2021-06-28 97fb2e4bf020d6c49ef42ad084b42439eb5976b5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.xzx.gc.util.limitnetflow;
 
import com.google.common.util.concurrent.RateLimiter;
 
/**
 * 令牌生成
 * 基于内存的限流算法
 */
public class TokenFactory {
 
    public static void init(){
        RateLimiter rateLimiter = RateLimiter.create(10);
        rateLimiter.acquire();
    }
 
    public static void main(String[] args) throws Exception{
 
 
        System.out.println("-----out-----");
    }
 
 
}