shelf_throttle 0.5.0 copy "shelf_throttle: ^0.5.0" to clipboard
shelf_throttle: ^0.5.0 copied to clipboard

A Shelf middleware that applies throttling to incoming requests.

Shelf Throttle #

A Shelf middleware that applies global throttling to all incoming requests with a given time window.

// Server
// Handle requests with a 5 seconds window.
final handler = throttle(Duration(seconds: 5)).addHandler(handleRequest);
await serve(handler, host, port);

// Client
// Handled with no delay.
get('$baseUrl/hello');
// Wait for 3 seconds of the 5 seconds window.
await Future.delayed(Duration(seconds: 3));
// Handled after another 2 seconds.
get('$baseUrl/world');
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Shelf middleware that applies throttling to incoming requests.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

shelf

More

Packages that depend on shelf_throttle