throttle
1.0.0
작곡가로 설치하십시오
composer require zeus/throttle강력한 Redis HTTP 요청을 처리하는 10 분 만에 100 개의 액세스와 같은 HTTP 요청 제한을 설정하면 모든 API 또는 프로젝트에 쉽게 통합 할 수 있습니다.
use Throttle Throttle ;
use Throttle Time ;
$ throttle = new Throttle (
new Time ( 60 , 25 )
);
$ throttle -> commit ();
if ( $ throttle -> isHasAccessLimit ()) {
print ' request can go next ' ;
} else {
print ' max request amount ' ;
}
use Throttle Throttle ;
use Throttle Time ;
use Throttle Redis ;
Redis:: setRedisClient ( new Predis Client ( $ params ));
$ throttle = new Throttle (
new Time ( 60 , 25 )
);
$ throttle -> commit ();
if ( $ throttle -> isHasAccessLimit ()) {
print ' request can go next ' ;
} else {
print ' max request amount ' ;
}세부 사항을 얻으십시오
$ throttle -> getDetail ()-> toArray ();