limingxinleo/jsonrpc-fpm-client

This package is abandoned and no longer maintained. No replacement package was suggested.

v2.0.1 2020-07-17 01:35 UTC

This package is auto-updated.

Last update: 2020-08-27 06:59:57 UTC


README

Build Status

声明

本组件已不再维护,请使用 JET

安装

composer require limingxinleo/jsonrpc-fpm-client

使用

实现 Client

<?php

use Xin\JsonRPC\FpmClient\Client;

/**
 * @method string id(string $id)
 * @method void exception()
 */
class IdGenerator extends Client
{
}

调用 RPC

<?php

use Xin\JsonRPC\FpmClient\Packer\JsonLengthPacker;
use Xin\JsonRPC\FpmClient\Transporter\TcpTransporter;

$client = new IdGenerator('IdGenerateService', new TcpTransporter('127.0.0.1', 9502), new JsonLengthPacker());
$ret = $client->id($id = uniqid());