From 38fd08587743ce69e30269fd2acfae60e3931ed9 Mon Sep 17 00:00:00 2001 From: da440dil Date: Sat, 18 Dec 2021 16:24:00 +0300 Subject: [PATCH] update readme --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3677b98..1ea8614 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,13 @@ func main() { err := client.Del(ctx, key).Err() requireNoError(err) - // Create limiter suite with 2 limiters. - ls := counter.NewLimiterSuite( + // Create limiter with 2 limiters. + ls := counter.NewLimiter( + client, // First limiter is limited to 3 calls per second. - counter.NewLimiter(counter.FixedWindow(client, time.Second, 3)), + counter.WithLimiter(time.Second, 3), // Second limiter is limited to 5 calls per 2 seconds. - counter.NewLimiter(counter.FixedWindow(client, time.Second*2, 5)), + counter.WithLimiter(time.Second*2, 5), ) limit := func() {