Open VovkaSOL opened 8 months ago
suspend fun suspendSendMsg(request: String): String {
return suspendCoroutine { continuation ->
try {
sendMsg(request) { response ->
//continuation.resumeWith(Result.failure(InternalTimeoutException( "Таймаут ответа ${request!!::class.java.canonicalName} со временем ожидания ${finalTimeout.toMillis()} миллисекунд" ) ))
continuation.resumeWith(Result.success(response))
}
} catch (e: Exception) {
LOGGER.error("что то сломалось при отправке iso сообщения", e)
throw RuntimeException("что то сломалось при отправке iso сообщения")
}
}
}
Hi, now client.send return future, but if we use Kotlin in client app, we can use coroutine for non blocking. Please add coroutine callback wrapper with suspendCoroutine.