Rate Limiter
Index
【Tip】
Please refer to:Limiter
Install Dependencies
composer require hyperf/rate-limit
Usage
#[GetMapping(path: 'rate/limit')]
#[RateLimit(create: 10, consume: 5, capacity: 50)]
public function rateLimit(): array
{
return $this->result->setData([
'QPS' => 5,
'CREATE TOKEN PER SECOND' => 10,
'CAPACITY' => 50,
])->getResult();
}