Skip to content

Commit ddd30e3

Browse files
committed
README.md
1 parent 31530e4 commit ddd30e3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,23 @@ class RandomIntServer
206206
}
207207
```
208208

209+
Отправка запроса и получение ответа от RPC:
210+
211+
1) Запустить сервер командой `php bin/rabbitmq bitrix-rabbitmq:rpc-server random_int`
212+
2) Код:
213+
214+
```php
215+
use Proklung\RabbitMq\Integration\DI\Services;
216+
use Proklung\RabbitMq\RabbitMq\RpcClient;
217+
218+
/** @var RpcClient $client */
219+
$client = Services::boot()->get('rabbitmq.integer_store_rpc');
220+
221+
$client->addRequest(serialize(array('min' => 0, 'max' => 10)), 'random_int', 'request_id');
222+
$replies = $client->getReplies();
223+
// Обработать $replies
224+
```
225+
209226
## Интеграция с CLI
210227

211228
Доступны некоторые команды, которые упрощают работу:

0 commit comments

Comments
 (0)