library swoft-rpc-client
其他框架调用Swoft RPC服务的客户端
limingxinleo/swoft-rpc-client
其他框架调用Swoft RPC服务的客户端
- Tuesday, July 17, 2018
- by limingxinleo
- Repository
- 1 Watchers
- 2 Stars
- 0 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
swoft-rpc-client
, (*1)
安装
composer require limingxinleo/swoft-rpc-client
使用
定义客户端, (*2)
<?php
namespace SwoftTest\Rpc\Testing\Clients;
use SwoftTest\Rpc\Testing\Lib\DemoServiceInterface;
use Swoftx\Rpc\Client\Client;
/**
* Class DemoService
* @package SwoftTest\Rpc\Testing\Clients
* @method version()
*/
class DemoService extends Client
{
/** @var PoolName */
protected $name = 'demo';
/** @var Pool ip */
protected $ip = '127.0.0.1';
/** @var Pool port */
protected $port = 8099;
/** @var Service interface */
protected $interface = DemoServiceInterface::class;
}
复制服务提供方的接口, (*3)
<?php
/**
* Swoft Entity Cache
*
* @author limx <715557344@qq.com>
* @link https://github.com/limingxinleo/swoft-rpc-client
*/
namespace SwoftTest\Rpc\Testing\Lib;
use Swoft\Core\ResultInterface;
/**
* Interface DemoServiceInterface
* @package SwoftTest\Db\Testing\Lib
* @method ResultInterface deferVersion()
*/
interface DemoServiceInterface
{
public function version();
}
调用, (*4)
<?php
use SwoftTest\Rpc\Testing\Clients\DemoService;
$client = DemoService::getInstance();
echo $client->version();
dev-master
9999999-dev
其他框架调用Swoft RPC服务的客户端
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
php
model
db
swoole
swoft
1.0.0
1.0.0.0
其他框架调用Swoft RPC服务的客户端
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
php
model
db
swoole
swoft