You are right, it seems weird. The main point of suspend functions is to perform synchronous non-blocking operations. Making suspend function asynchronous (as you did) is usually a mistake.
What about this?
suspend fun customerSummaryTwo(req: GenericIntEQ) : CustomerPDSummaryDTO {
return jsonClient.post<CustomerPDSummaryDTO>("http://localhost:8080/customerSummary"){
contentType(ContentType.Application.Json)
body = req
}
}
And then just:
val result = PredictService.customerSummaryTwo(_req)
Note that you can do this only if jsonClient.post() is also suspend. I guess it actually is as it looks like Ktor client. If it wouldn’t be suspend, but blocking instead, you would need to wrap this call with withContext(Dispatchers.IO) { }.