Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
da440dil committed Dec 18, 2021
1 parent 97ca004 commit 38fd085
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 38fd085

Please sign in to comment.