-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# Eclipse Vert.x Rate Limiter | ||
|
||
configurable in-memory rate limiter | ||
|
||
```kotlin | ||
val clients: Storage = Storage.newInstance() | ||
val throttling: ThrottleImpl = Throttl | ||
.getThrottling(vertx, null, clients) | ||
.includeHeaders(true) // will add rate limit headers to the response. | ||
.throttlingRequest(30) // requests limit. | ||
.throttlingTime(60) // time limit. | ||
.throttlingTimeUnit(TimeUnit.SECONDS) // time unit. | ||
|
||
val router = throttling.getRouter() | ||
``` |