1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-10-07 09:55:03 +00:00
tgbotapi/docs/dev.inmo.tgbotapi.bot/-requests-executor/index.md
2021-03-17 15:18:37 +00:00

10 KiB

//docs/dev.inmo.tgbotapi.bot/RequestsExecutor

RequestsExecutor

[common] interface RequestsExecutor :

Interface for making requests to Telegram Bot API. Currently, there is only one built-in implementation - dev.inmo.tgbotapi.bot.Ktor.KtorRequestsExecutor

See also

common

dev.inmo.tgbotapi.requests.abstracts.Request
dev.inmo.tgbotapi.bot.Ktor.KtorRequestsExecutor

Functions

Name Summary
close [common]
Content
abstract fun close()


execute [common]
Content
abstract suspend fun <T : Any> execute(request: Request<T>): T
More info
Unsafe execution of incoming request.


Inheritors

Name
BaseRequestsExecutor
BehaviourContext

Extensions

Name Summary
executeAsync [common]
Content
fun <T : Any> RequestsExecutor.executeAsync(request: Request<T>, scope: ): <T>
suspend fun <T : Any> RequestsExecutor.executeAsync(request: Request<T>): <T>


executeUnsafe [common]
Content
suspend fun <T : Any> RequestsExecutor.executeUnsafe(request: Request<T>, retries: Int = 0, retriesDelay: Long = 1000L, onAllFailed: suspend (exceptions: Array<Throwable>) -> Unit? = null): T?


setWebhookInfoAndStartListenWebhooks [jvm]
Content
suspend fun RequestsExecutor.setWebhookInfoAndStartListenWebhooks(listenPort: Int, engineFactory: <*, *>, setWebhookRequest: SetWebhookRequest, exceptionsHandler: <Unit> = {}, listenHost: String = "0.0.0.0", listenRoute: String = "/", privateKeyConfig: WebhookPrivateKeyConfig? = null, scope: = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), mediaGroupsDebounceTimeMillis: Long = 1000L, block: <Update>):
More info
Setting up ktor server, set webhook info via SetWebhookRequest request.


startGettingOfUpdatesByLongPolling [common]
Content
fun RequestsExecutor.startGettingOfUpdatesByLongPolling(updatesFilter: UpdatesFilter, timeoutSeconds: Seconds = 30, exceptionsHandler: <Unit>? = null, scope: = CoroutineScope(Dispatchers.Default)):