KtorPipelineStepsHolder

Types

Link copied to clipboard

Functions

Link copied to clipboard
open suspend fun <T : Any> onAfterCallFactoryMakeCall(result: T?, request: Request<T>, potentialFactory: KtorCallFactory): T?

Will always be called after potentialFactory has tried to make request and got some result. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead

Link copied to clipboard
open suspend fun onBeforeCallFactoryMakeCall(request: Request<*>, potentialFactory: KtorCallFactory)

Will always be called before potentialFactory will try to make request

Link copied to clipboard
open suspend fun onBeforeSearchCallFactory(request: Request<*>, callsFactories: List<KtorCallFactory>)

Will always be called before requests executor will check all callsFactories for an opportunity to make call of request

Link copied to clipboard
open suspend fun <T : Any> onRequestException(request: Request<T>, t: Throwable): T?

Will be called when any exception will happen due to the request handling. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead

Link copied to clipboard
open suspend fun <T : Any> onRequestResultAbsent(request: Request<T>, callsFactories: List<KtorCallFactory>): T?

Will be called when there is no KtorCallFactory from callsFactories which may handle request. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead

Link copied to clipboard
open suspend fun <T : Any> onRequestResultPresented(result: T, request: Request<T>, resultCallFactory: KtorCallFactory, callsFactories: List<KtorCallFactory>): T?

Will be called when resultCallFactory is the KtorCallFactory from callsFactories which has successfully handled request and returned result. If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead

Link copied to clipboard
open suspend fun <T : Any> onRequestReturnResult(result: Result<T>, request: Request<T>, callsFactories: List<KtorCallFactory>): T

This step will be called when the result has been retrieved (or exception has happened). If returns value - that value will be returned from dev.inmo.tgbotapi.bot.RequestsExecutor.execute instead