1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-02 22:59:48 +00:00

executes was replaced

This commit is contained in:
2020-06-02 13:39:09 +06:00
parent 6073d914d5
commit 1fb2ecf15f
4 changed files with 52 additions and 3 deletions

View File

@@ -13,8 +13,8 @@ import io.ktor.utils.io.core.Closeable
interface RequestsExecutor : Closeable {
/**
* Unsafe execution of incoming [request]. Can throw almost any exception. So, it is better to use
* something like [com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.executeAsync] or
* [com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.executeUnsafe]
* something like [com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.shortcuts.executeAsync] or
* [com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.shortcuts.executeUnsafe]
*
* @throws Exception
*/

View File

@@ -7,7 +7,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.Response
import com.github.insanusmokrassar.TelegramBotAPI.utils.handleSafely
import kotlinx.coroutines.*
@Deprecated("Will be removed in next major update")
fun <T: Any> RequestsExecutor.executeAsync(
request: Request<T>,
onFail: (suspend (Response) -> Unit)? = null,
@@ -24,6 +24,7 @@ fun <T: Any> RequestsExecutor.executeAsync(
}
}
@Deprecated("Replaced and modified inside of TelegramBotAPI-extensions-utils")
fun <T: Any> RequestsExecutor.executeAsync(
request: Request<T>,
scope: CoroutineScope = GlobalScope
@@ -31,6 +32,7 @@ fun <T: Any> RequestsExecutor.executeAsync(
return scope.async { execute(request) }
}
@Deprecated("Replaced and modified inside of TelegramBotAPI-extensions-utils")
suspend fun <T: Any> RequestsExecutor.executeUnsafe(
request: Request<T>,
retries: Int = 0,