From b032908fa24cee73998db7cacf474427d81c04ce Mon Sep 17 00:00:00 2001 From: Vyacheslav Artemyev Date: Wed, 13 Mar 2019 11:52:23 +0200 Subject: [PATCH] Update docs --- README.md | 17 +++++++++-------- build.gradle | 4 ++-- .../exception/PublishException.kt | 4 ---- 3 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 src/main/kotlin/com/viartemev/thewhiterabbit/exception/PublishException.kt diff --git a/README.md b/README.md index d4011d94..204acfd8 100644 --- a/README.md +++ b/README.md @@ -37,19 +37,20 @@ compile 'com.viartemev:the-white-rabbit:$version' ##### - Async message publishing with confirmation: ```kotlin connection.confirmChannel { - publish { - coroutineScope { - (1..n).map { asyncPublishWithConfirm(createMessage("Hello #$it")) }.awaitAll() - } + publish { + val messages = (1..n).map { createMessage("Hello #$it") } + publishWithConfirmAsync(coroutineContext, messages).awaitAll() } } ``` or ```kotlin connection.confirmChannel { - publish { - val messages = (1..n).map { createMessage("Hello #$it") } - asyncPublishWithConfirm(messages).awaitAll() + publish { + coroutineScope { + val messages = (1..n).map { createMessage("Hello #$it") } + messages.map { async { publishWithConfirm(it) } } + } } } ``` @@ -59,7 +60,7 @@ Consume only n-messages: ```kotlin connection.channel { consume(QUEUE_NAME, PREFETCH_COUNT) { - (1..n).map { asyncConsumeWithConfirm({ println(it) }) }.awaitAll() + (1..n).map { async { consumeMessageWithConfirm({ println(it) }) } }.awaitAll() } } ``` diff --git a/build.gradle b/build.gradle index 1f8c2cdb..44cefea6 100644 --- a/build.gradle +++ b/build.gradle @@ -82,7 +82,7 @@ configure(allprojects) { project -> } configure(rootProject) { - version = '0.0.4' + version = '0.0.5' apply plugin: "com.novoda.bintray-release" apply plugin: 'com.adarshr.test-logger' @@ -103,7 +103,7 @@ configure(rootProject) { repoName = 'Maven' groupId = 'com.viartemev' artifactId = 'the-white-rabbit' - publishVersion = '0.0.4' + publishVersion = '0.0.5' desc = 'The White Rabbit is an asynchronous RabbitMQ library based on Kotlin coroutines' website = 'https://github.com/viartemev/the-white-rabbit' licences = ['MIT'] diff --git a/src/main/kotlin/com/viartemev/thewhiterabbit/exception/PublishException.kt b/src/main/kotlin/com/viartemev/thewhiterabbit/exception/PublishException.kt deleted file mode 100644 index 823a1fd5..00000000 --- a/src/main/kotlin/com/viartemev/thewhiterabbit/exception/PublishException.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.viartemev.thewhiterabbit.exception - -class PublishException(message: String) : RuntimeException(message) -