Overview

Namespaces

  • bandwidthThrottle
    • tokenBucket
      • storage
        • scope

Classes

  • BlockingConsumer
  • Rate
  • TokenBucket

Exceptions

  • TimeoutException
  • TokenBucketException
  • Overview
  • Namespace
  • Class

Class Rate

The rate.

Final
Namespace: bandwidthThrottle\tokenBucket
License: WTFPL
Author: Markus Malkusch markus@malkusch.de
Link: Donations
Located at Rate.php
Methods summary
public
# __construct( integer $tokens, string $unit )

Sets the amount of tokens which will be produced per unit.

Sets the amount of tokens which will be produced per unit.

E.g. new Rate(100, Rate::SECOND) will produce 100 tokens per second.

Parameters

$tokens
positive amount of tokens to produce per unit
$unit
unit as one of Rate's constants
Constants summary
string MICROSECOND
# "microsecond"
string MILLISECOND
# "millisecond"
string SECOND
# "second"
string MINUTE
# "minute"
string HOUR
# "hour"
string DAY
# "day"
string WEEK
# "week"
string MONTH
# "month"
string YEAR
# "year"
API documentation generated by ApiGen