PHP code example of limingxinleo / x-swoole-rpc

1. Go to this page and download the library: Download limingxinleo/x-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/ */

    

limingxinleo / x-swoole-rpc example snippets




use Xin\Swoole\Rpc\Server;

use Xin\Swoole\Rpc\Handler\Handler;

class TestHandler extends Handler
{
    public function test()
    {
        return 'success';
    }


use Xin\Swoole\Rpc\Client\Client;

/**
 * Class TestClient
 * @method test
 */
class TestClient extends Client
{
    protected $service = 'test';

    protected $host = '127.0.0.1';

    protected $port = 11520;