PHP Class Tolerance\Throttling\RateLimit\LeakyBucket

Inheritance: implements Tolerance\Throttling\RateLimit\RateLimit
Afficher le fichier Open project: sroze/tolerance Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Tolerance\Throttling\RateMeasureStorage\RateMeasureStorage $storage, Tolerance\Throttling\Rate\Rate $rate )
getTicksBeforeUnderLimit ( $identifier )
hasReachedLimit ( $identifier )
tick ( $identifier )

Private Methods

Méthode Description
computeCurrentRate ( string $identifier ) : float Create the current rate.
getMeasure ( string $identifier ) : Tolerance\Throttling\RateMeasure\RateMeasure

Method Details

__construct() public méthode

public __construct ( Tolerance\Throttling\RateMeasureStorage\RateMeasureStorage $storage, Tolerance\Throttling\Rate\Rate $rate )
$storage Tolerance\Throttling\RateMeasureStorage\RateMeasureStorage
$rate Tolerance\Throttling\Rate\Rate

getTicksBeforeUnderLimit() public méthode

public getTicksBeforeUnderLimit ( $identifier )

hasReachedLimit() public méthode

public hasReachedLimit ( $identifier )

tick() public méthode

public tick ( $identifier )