1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-23 02:28:45 +00:00

RequestsExecutor now is Closeable

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

View File

@ -8,6 +8,8 @@
* Joda Time version `2.10.1` -> `2.10.3` * Joda Time version `2.10.1` -> `2.10.3`
* Ktor version `1.1.4` -> `1.2.2` * Ktor version `1.1.4` -> `1.2.2`
* `RequestsExecutor` now is `Closeable`
## 0.16.0 Bot API 4.3 ## 0.16.0 Bot API 4.3
* `LoginURL` and `LoginURLInlineKeyboardButton` has been added * `LoginURL` and `LoginURLInlineKeyboardButton` has been added

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.bot.exceptions.RequestException
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import kotlinx.io.core.Closeable
interface RequestsExecutor { interface RequestsExecutor : Closeable {
@Throws(RequestException::class) @Throws(RequestException::class)
suspend fun <T : Any> execute(request: Request<T>): T suspend fun <T : Any> execute(request: Request<T>): T
} }