Skip to content

Commit

Permalink
Improve README a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
julik committed Oct 31, 2023
1 parent 1fae3d0 commit 30c1ed4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ throttle.request!(20) # Attempt to withdraw 20 dollars more
throttle.request!(2) # Attempt to withdraw 2 dollars more, will raise `Throttled` and block withdrawals for 3 hours
```

Sometimes you don't want to use a throttle, but you want to track the amount added to the leaky bucket over time. If this is what you need, you can use the `LeakyBucket` class:
Sometimes you don't want to use a throttle, but you want to track the amount added to the leaky bucket over time. A lower-level abstraction is available for that purpose in the form of the `LeakyBucket` class. It will not raise any exceptions and will not install blocks, but will permit you to track a bucket's state over time:


```ruby
b = Pecorino::LeakyBucket.new(key: "some_b", capacity: 100, leak_rate: 5)
Expand Down

0 comments on commit 30c1ed4

Please sign in to comment.