8000 GitHub - andrewaylett/throttle: Automatically throttles calls in response to failures
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

andrewaylett/throttle

Repository files navigation

Throttle

As a service client, there's little point in sending requests to the service that we can be reasonably sure will fail.

This is a simple library that provides a way to throttle requests to a service based on the number of requests that have been sent in the past. It uses a sliding window algorithm to determine if a request should be sent or not.

The concept comes from chapter 21 of the SRE book. The author has previously released self-throttle, for Node.js. This library is a new implementation of the same concept, rather than a port.

Usage

Include the library in your dependencies:

dependencies {
    implementation 'eu.aylett:throttle:0.1.1'
}

About

Automatically throttles calls in response to failures

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages

0