throttle
1.0.0
تثبيت مع الملحن
composer require zeus/throttleيحدد قيود طلب HTTP ، مثل 100 وصول فقط في 10 دقائق يتعامل Redis Strows على طلبات 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 ();