docs

# SimpleMultiServerRequestsExecutor

class SimpleMultiServerRequestsExecutor ( bots: List < TelegramBot >, botSelector: suspend List < TelegramBot >.(currentBotIndex: Int , t: Throwable ?) -> TelegramBot = { i, _ -> getOrElse(i + 1) { first() } }, onClose: () -> Unit = { bots.forEach(TelegramBot::close) }) : RequestsExecutor
Content copied to clipboard

This type of RequestsExecutor (aka TelegramBot) has been created to aggregate several bots under the hood and make requests, for example, with changing of api url

## Parameters

bots

Bots which will be used to executes

botSelector

It is strategy by which the bot is selected for the execution. This lambda will receive -1 when request execution just started and this call is first in context of one execute. By default, will select next TelegramBot when called (or first when current index is last or -1)

onClose

This method will be called inside of close method. By default, will close all bots

## Constructors

SimpleMultiServerRequestsExecutor
Link copied to clipboard
fun SimpleMultiServerRequestsExecutor ( bots: List < TelegramBot >, botSelector: suspend List < TelegramBot >.(currentBotIndex: Int , t: Throwable ?) -> TelegramBot = { i, _ -> getOrElse(i + 1) { first() } }, onClose: () -> Unit = { bots.forEach(TelegramBot::close) })
Content copied to clipboard

## Types

Companion
Link copied to clipboard
object Companion
Content copied to clipboard

## Functions

close
Link copied to clipboard
open override fun close ()
Content copied to clipboard
execute
Link copied to clipboard
open suspend override fun < T : Any > execute (request: Request < T >): T
Content copied to clipboard

Unsafe execution of incoming request. Can throw almost any exception. So, it is better to use something like dev.inmo.tgbotapi.extensions.utils.shortcuts.executeAsync or dev.inmo.tgbotapi.extensions.utils.shortcuts.executeUnsafe