dave08
03/14/2023, 2:50 PMAleksei Tirman [JB]
03/14/2023, 2:59 PMdave08
03/14/2023, 3:00 PMAleksei Tirman [JB]
03/14/2023, 3:01 PMdave08
03/14/2023, 3:03 PMokHttpClient.newBuilder().apply {
connectTimeout(30, TimeUnit.SECONDS)
readTimeout(1, TimeUnit.MINUTES)
writeTimeout(1, TimeUnit.MINUTES)
}.build()
CLOVIS
03/14/2023, 4:59 PMwithTimeout(5000) {
…rest of your code…
}
https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/with-timeout.html
If you want to apply it to your entire application, I think you'll have to create a custom plugin. It's not hard to dodave08
03/14/2023, 5:00 PM