Skip to content

Commit

Permalink
Try to improve README for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
brandur committed Nov 6, 2016
1 parent 7bfabab commit f4f6153
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,22 @@ the module. It's used like this:
TH.THROTTLE <key> <max_burst> <count per period> <period> [<quantity>]
```

For example (here `quantity` defaults to 1):
For example:

```
TH.THROTTLE user123 15 30 60
▲ ▲ ▲ ▲
| | └──┴──── 30 tokens / 60 seconds
| └────────── 15 max_burst
└──────────────── key "user123"
TH.THROTTLE user123 15 30 60 1
▲ ▲ ▲ ▲ ▲
| | | | └───── apply 1 token (default if omitted)
| | └──┴─────── 30 tokens / 60 seconds
| └───────────── 15 max_burst
└─────────────────── key "user123"
```

This means that a single token should be applied against the rate limit of the
key `user123`. 30 tokens on the key are allowed over a 60 second period with a
maximum initial burst of 15 tokens. Rate limiting parameters are provided with
every invocation so that limits can easily be reconfigured on the fly.
This means that a single token (the `1` in the last parameter) should be
applied against the rate limit of the key `user123`. 30 tokens on the key are
allowed over a 60 second period with a maximum initial burst of 15 tokens. Rate
limiting parameters are provided with every invocation so that limits can
easily be reconfigured on the fly.

The command will respond with an array of integers:

Expand Down

0 comments on commit f4f6153

Please sign in to comment.