1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-06 00:29:39 +00:00

RequestsExecutor now is Closeable

This commit is contained in:
2019-07-23 07:46:19 +08:00
parent 4dba67979d
commit d8887bb7ff
3 changed files with 8 additions and 1 deletions

View File

@@ -83,4 +83,8 @@ class KtorRequestsExecutor(
}
}
}
override fun close() {
client.close()
}
}

View File

@@ -2,8 +2,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot
import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import kotlinx.io.core.Closeable
interface RequestsExecutor {
interface RequestsExecutor : Closeable {
@Throws(RequestException::class)
suspend fun <T : Any> execute(request: Request<T>): T
}