File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
src/main/kotlin/com/viartemev/thewhiterabbit/exception Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -37,19 +37,20 @@ compile 'com.viartemev:the-white-rabbit:$version'
37
37
##### - Async message publishing with confirmation:
38
38
``` kotlin
39
39
connection.confirmChannel {
40
- publish {
41
- coroutineScope {
42
- (1 .. n).map { asyncPublishWithConfirm(createMessage(" Hello #$it " )) }.awaitAll()
43
- }
40
+ publish {
41
+ val messages = (1 .. n).map { createMessage(" Hello #$it " ) }
42
+ publishWithConfirmAsync(coroutineContext, messages).awaitAll()
44
43
}
45
44
}
46
45
```
47
46
or
48
47
``` kotlin
49
48
connection.confirmChannel {
50
- publish {
51
- val messages = (1 .. n).map { createMessage(" Hello #$it " ) }
52
- asyncPublishWithConfirm(messages).awaitAll()
49
+ publish {
50
+ coroutineScope {
51
+ val messages = (1 .. n).map { createMessage(" Hello #$it " ) }
52
+ messages.map { async { publishWithConfirm(it) } }
53
+ }
53
54
}
54
55
}
55
56
```
@@ -59,7 +60,7 @@ Consume only n-messages:
59
60
``` kotlin
60
61
connection.channel {
61
62
consume(QUEUE_NAME , PREFETCH_COUNT ) {
62
- (1 .. n).map { asyncConsumeWithConfirm ({ println (it) }) }.awaitAll()
63
+ (1 .. n).map { async { consumeMessageWithConfirm ({ println (it) }) } }.awaitAll()
63
64
}
64
65
}
65
66
```
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ configure(allprojects) { project ->
82
82
}
83
83
84
84
configure(rootProject) {
85
- version = ' 0.0.4 '
85
+ version = ' 0.0.5 '
86
86
87
87
apply plugin : " com.novoda.bintray-release"
88
88
apply plugin : ' com.adarshr.test-logger'
@@ -103,7 +103,7 @@ configure(rootProject) {
103
103
repoName = ' Maven'
104
104
groupId = ' com.viartemev'
105
105
artifactId = ' the-white-rabbit'
106
- publishVersion = ' 0.0.4 '
106
+ publishVersion = ' 0.0.5 '
107
107
desc = ' The White Rabbit is an asynchronous RabbitMQ library based on Kotlin coroutines'
108
108
website = ' https://github.com/viartemev/the-white-rabbit'
109
109
licences = [' MIT' ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments