Skip to content

Rackbeat/php-throttler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rackbeat throttler
Throttle PHP actions to only run a set amount of times within a given timeframe.
Especially useful to avoid rate limiting, high CPU usage or DOS'ing your own services (database etc.)

Build Status Coverage Total Downloads Latest Stable Version License

Installation

You just require using composer and you're good to go!

composer require rackbeat/php-throttler

Usage

Basic example

use Rackbeat\Throttler\Throttler;

Throttler::make( range(1,100) )->allow(10)->every(1)->run( function($value, $key) {
    // do something with $value
} );

Requirements

  • PHP >= 7.3

About

Throttle PHP actions to avoid external rate limiting etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages