rhinonet / golimiter
限流 gRPC Client
dev-master
2020-04-10 22:24 UTC
Requires
- phpunit/phpunit: ^7.5
Requires (Dev)
- google/protobuf: 3.4.0
- grpc/grpc: dev-master
This package is auto-updated.
Last update: 2025-03-11 09:26:05 UTC
README
限流服务客户端
Installation
composer require rhinonet/golimiter
Example
<?php require dirname(__FILE__).'/vendor/autoload.php'; function greet($alias) { $client = new Limiter\RateLimiterClient('localhost:50053', [ 'credentials' => Grpc\ChannelCredentials::createInsecure(), ]); $request = new Limiter\GetRateRequest(); $request->setAlias($alias); list($reply, $status) = $client->GetRate($request)->wait(); $mes['ret'] = $reply->getRet(); $mes['permits'] = $reply->getPermits(); return $mes; } var_dump(greet("project1"));