LimiterInterface
interface LimiterInterface
Methods
Reservation
reserve(int$tokens =1,float|null$maxTime =null)
Waits until the required number of tokens is available.
RateLimit
consume(int$tokens =1)
Use this method if you intend to drop if the required number of tokens is unavailable.
void
reset()
Resets the limit.
Details
Reservation
reserve(int$tokens =1,float|null$maxTime =null)
Waits until the required number of tokens is available.
The reserved tokens will be taken into account when calculating future token consumptions. Do not use this method if you intend to skip this process.