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'
3737##### - Async message publishing with confirmation:
3838``` kotlin
3939connection.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()
4443 }
4544}
4645```
4746or
4847``` kotlin
4948connection.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+ }
5354 }
5455}
5556```
@@ -59,7 +60,7 @@ Consume only n-messages:
5960``` kotlin
6061connection.channel {
6162 consume(QUEUE_NAME , PREFETCH_COUNT ) {
62- (1 .. n).map { asyncConsumeWithConfirm ({ println (it) }) }.awaitAll()
63+ (1 .. n).map { async { consumeMessageWithConfirm ({ println (it) }) } }.awaitAll()
6364 }
6465}
6566```
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ configure(allprojects) { project ->
8282}
8383
8484configure(rootProject) {
85- version = ' 0.0.4 '
85+ version = ' 0.0.5 '
8686
8787 apply plugin : " com.novoda.bintray-release"
8888 apply plugin : ' com.adarshr.test-logger'
@@ -103,7 +103,7 @@ configure(rootProject) {
103103 repoName = ' Maven'
104104 groupId = ' com.viartemev'
105105 artifactId = ' the-white-rabbit'
106- publishVersion = ' 0.0.4 '
106+ publishVersion = ' 0.0.5 '
107107 desc = ' The White Rabbit is an asynchronous RabbitMQ library based on Kotlin coroutines'
108108 website = ' https://github.com/viartemev/the-white-rabbit'
109109 licences = [' MIT' ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments