From 6cc84c0e49fce902be79ac15d2c1dd31228e166b Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Tue, 23 Sep 2025 21:11:39 +0800 Subject: [PATCH] =?UTF-8?q?docs(=E5=BE=AE=E8=B0=83=E6=96=87=E6=A1=A3):=20?= =?UTF-8?q?=E5=AF=B9=E6=96=87=E6=A1=A3=E8=BF=9B=E8=A1=8C=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 0308f96..cb911db 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,10 @@ func main() { limiter := limit.New() // 2. 确保在程序退出前优雅地停止后台任务,这非常重要 defer limiter.Stop() - // 3. 为任意键 "some-key" 获取一个速率限制器 // - rate.Limit(2): 表示速率为 "每秒2个请求" // - 2: 表示桶的容量 (Burst),允许瞬时处理2个请求 rateLimiter := limiter.Get("some-key", rate.Limit(2), 2) - // 4. 模拟3次连续的突发请求 // 由于速率和容量都为2,只有前两次请求能立即成功 for i := 0; i < 3; i++ {