The token bucket algorithm originally originated from computer networks. When transmitting data on the network, in order to prevent network congestion, it is necessary to limit the flow out of the network, so that the flow is sent out at a relatively uniform speed. The token bucket algorithm implements this function, which can control the amount of data sent to the network and allow burst data to be sent.
1、https://blog.csdn.net/sunnyyoona/article/details/51228456
2、https://github.com/yangwenmai/ratelimit
3、https://juejin.im/post/5ab10045518825557005db65
4、https://www.jianshu.com/p/aee778f84e7b