Skip to content

Commit 7500c7d

Browse files
Артемьев ВячеславАртемьев Вячеслав
authored andcommitted
Add RPC docs
1 parent 694ad8f commit 7500c7d

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ The White Rabbit is a [fast](https://github.com/viartemev/the-white-rabbit/issue
1414
* RPC pattern
1515

1616
## Adding to project
17-
### Gradle
17+
<details><summary>Gradle</summary>
18+
1819
```
1920
repositories {
2021
jcenter()
2122
}
2223
2324
compile 'com.viartemev:the-white-rabbit:$version'
2425
```
25-
### Maven
26+
</details>
27+
28+
<details><summary>Maven</summary>
29+
2630
```
2731
<repositories>
2832
<repository>
@@ -37,6 +41,7 @@ compile 'com.viartemev:the-white-rabbit:$version'
3741
<version>${version}</version>
3842
</dependency>
3943
```
44+
</details>
4045

4146
## Usage notes and examples
4247

@@ -131,7 +136,21 @@ connection.txChannel {
131136
```
132137

133138
### RPC pattern
134-
TBD
139+
```kotlin
140+
connection.channel {
141+
val message = RabbitMqMessage(MessageProperties.PERSISTENT_BASIC, "Hello world".toByteArray())
142+
coroutineScope {
143+
(1..10).map {
144+
async {
145+
rpc {
146+
call(requestQueueName = "rpc_request", message = message)
147+
.also { println("Reply: ${String(it.body)}") }
148+
}
149+
}
150+
}.awaitAll()
151+
}
152+
}
153+
```
135154

136155
## Links
137156
* [Benchmarks](https://github.com/viartemev/the-white-rabbit/issues/88#issuecomment-470461937)

0 commit comments

Comments
 (0)