PHP code example of limingxinleo / swoft-rpc-client

1. Go to this page and download the library: Download limingxinleo/swoft-rpc-client 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 / swoft-rpc-client example snippets


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;

/**
 * Swoft Entity Cache
 *
 * @author   limx <[email protected]>
 * @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();