PHPackages                             rryqszq4/jsonrpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. rryqszq4/jsonrpc

ActiveLibrary[API Development](/categories/api)

rryqszq4/jsonrpc
================

Lightweight, fast JsonRPC 2.0 client/server of PHP extension，base on multi\_curl + epoll of client.

3619[3 issues](https://github.com/rryqszq4/JsonRPC/issues)C

Since Feb 10Pushed 9y ago9 watchersCompare

[ Source](https://github.com/rryqszq4/JsonRPC)[ Packagist](https://packagist.org/packages/rryqszq4/jsonrpc)[ RSS](/packages/rryqszq4-jsonrpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (1)Used By (0)

JsonRPC 2.0 Client and Server
=============================

[](#jsonrpc-20-client-and-server)

[![Build Status](https://camo.githubusercontent.com/4804d7f84aab2e1b90f9b9a9d675fb1d28df0d280aa0c2d2c07d13003d2095a5/68747470733a2f2f7472617669732d63692e6f72672f72727971737a71342f7068702d4a736f6e5250432e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rryqszq4/php-JsonRPC)

Lightweight, fast multi Json-RPC 2.0 client/server in php extension, base on multi\_curl and epoll of the Client. Coroutine in async of writeback, just look like the sync of php response and it is. Jsonrpc\_Server support php-fpm or swoole Compliance  protocol specification. [中文](https://github.com/rryqszq4/JsonRPC/blob/master/README-cn.md)

[jsonrpc in php7](https://github.com/rryqszq4/php7-ext-jsonrpc)

Features
--------

[](#features)

- JSON-RPC 2.0 protocol
- Base on curl and epoll of the multi client
- Persistent epoll in php-fpm
- Persistent curl\_multi queue in php-fpm
- Default use JSON parse/generate library YAJL
- Support message and notification
- Linux only(need to epoll)

Requirement
-----------

[](#requirement)

- PHP 5.3.\*
- PHP 5.4.\*
- PHP 5.5.\*
- PHP 5.6.\*

Install
-------

[](#install)

```
$/path/to/phpize
$./configure --with-php-config=/path/to/php-config
$make && make install

```

Server
------

[](#server)

**Interface**

- Jsonrpc\_Server::\_\_construct(mixed $payload, array $callbacks, array $classes)
- Jsonrpc\_Server::register(string $name, mixed $closure)
- Jsonrpc\_Server::bind(string $procedure, mixed $classname, string $method)
- Jsonrpc\_Server::jsonformat()
- Jsonrpc\_Server::rpcformat(mixed $payload)
- Jsonrpc\_Server::executeprocedure(string $procedure, array $params)
- Jsonrpc\_Server::executecallback(object $closure, array $params)
- Jsonrpc\_Server::executemethod(string $class, string $method, array $params)
- Jsonrpc\_Server::execute(boolean $response\_type)

**Register Function**

```
