PHP code example of xiaolin / swoole-rpc
1. Go to this page and download the library: Download xiaolin/swoole-rpc library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xiaolin / swoole-rpc example snippets
use Lin\Swoole\Rpc\Server;
use Lin\Swoole\Rpc\Handler\HanderInterface;
use Lin\Swoole\Rpc\Code\InstanceTrait;
class TestHandler implements HanderInterface
{
use InstanceTrait;
public function test()
{
return 'success';
}
use Lin\Swoole\Rpc\Client\Client;
/**
* Class TestClient
* @method test
*/
class TestClient extends Client
{
protected $service = 'test';
protected $host = '127.0.0.1';
protected $port = 11520;