mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
add docs for RequestsExecutor
This commit is contained in:
parent
738e628a89
commit
67fafdac00
@ -3,9 +3,19 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
||||
import io.ktor.utils.io.core.Closeable
|
||||
|
||||
/**
|
||||
* Interface for making requests to Telegram Bot API
|
||||
*
|
||||
* @see Request
|
||||
* @see com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor
|
||||
*/
|
||||
interface RequestsExecutor : Closeable {
|
||||
/**
|
||||
* @throws com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException
|
||||
* 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]
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
suspend fun <T : Any> execute(request: Request<T>): T
|
||||
}
|
Loading…
Reference in New Issue
Block a user