1 | <?php |
||
15 | class JsonRPC |
||
16 | { |
||
17 | /** @var \Spiral\Goridge\ConnectionInterface */ |
||
18 | private $conn; |
||
19 | |||
20 | /** |
||
21 | * @param \Spiral\Goridge\ConnectionInterface $conn |
||
22 | */ |
||
23 | public function __construct(ConnectionInterface $conn) |
||
27 | |||
28 | /** |
||
29 | * @param string $method |
||
30 | * @param mixed $argument An input argument or array of arguments for complex types. |
||
31 | * @param int $flags Payload control flags. |
||
32 | * |
||
33 | * @return mixed |
||
34 | * |
||
35 | * @throws \Spiral\Goridge\Exceptions\TransportException |
||
36 | * @throws \Spiral\Goridge\Exceptions\ServiceException |
||
37 | */ |
||
38 | public function call(string $method, $argument, int $flags = 0) |
||
60 | |||
61 | /** |
||
62 | * Handle response body. |
||
63 | * |
||
64 | * @param string|binary $body |
||
65 | * @param int $flags |
||
66 | * |
||
67 | * @return mixed |
||
68 | * |
||
69 | * @throws \Spiral\Goridge\Exceptions\ServiceException |
||
70 | */ |
||
71 | protected function handleBody($body, int $flags) |
||
83 | } |
||
84 |