1 | <?php |
||
15 | class RPC |
||
16 | { |
||
17 | /** @var Relay */ |
||
18 | private $relay; |
||
19 | |||
20 | /** |
||
21 | * @param Relay $relay |
||
22 | */ |
||
23 | public function __construct(Relay $relay) |
||
27 | |||
28 | /** |
||
29 | * @param string $method |
||
30 | * @param mixed $payload An binary data or array of arguments for complex types. |
||
31 | * @param int $flags Payload control flags. |
||
32 | * |
||
33 | * @return mixed |
||
34 | * |
||
35 | * @throws Exceptions\RelayException |
||
36 | * @throws Exceptions\ServiceException |
||
37 | */ |
||
38 | public function call(string $method, $payload, int $flags = 0) |
||
58 | |||
59 | /** |
||
60 | * Handle response body. |
||
61 | * |
||
62 | * @param string $body |
||
63 | * @param int $flags |
||
64 | * |
||
65 | * @return mixed |
||
66 | * |
||
67 | * @throws Exceptions\ServiceException |
||
68 | */ |
||
69 | protected function handleBody($body, int $flags) |
||
81 | } |