This PR adds BudgetTrait and Bucket traits to allow users to implement their budget and bucket implementations. The current Budget struct is changed to be generic over Bucket. The current Bucket implementation is also renamed as TpsBucket.
A new SimpleBucket struct is added. This bucket works by increasing the cost of the next retry on each retry request. Cost is then decreased gradually on each successful request.
This PR adds
BudgetTrait
andBucket
traits to allow users to implement their budget and bucket implementations. The currentBudget
struct is changed to be generic overBucket
. The currentBucket
implementation is also renamed asTpsBucket
.A new
SimpleBucket
struct is added. This bucket works by increasing the cost of the next retry on each retry request. Cost is then decreased gradually on each successful request.