From 05e0ec704e386ca3d16ecc1151691d0e72e5d0a6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 31 Jan 2019 09:53:58 +0800 Subject: [PATCH] RequestsExecutor.executeAsync(...): Deferred --- CHANGELOG.md | 2 ++ .../TelegramBotAPI/utils/extensions/RequestsExecutor.kt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 958b0211d3..1175042bb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ must be regular text ### 0.9.2 +* `RequestsExecutor#executeAsync(Request, CoroutineScope)` now will return `Deferred` for cases when you need result + ### 0.8.5 * Add extension `String#toMarkdown` diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt index 5d9165a40c..564517415f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/RequestsExecutor.kt @@ -164,7 +164,7 @@ fun RequestsExecutor.executeAsync( fun RequestsExecutor.executeAsync( request: Request, scope: CoroutineScope = GlobalScope -): Job { +): Deferred { return scope.async { execute(request) } }