I'm using the Ktor CIO client to call an external ...
# ktor
o
I'm using the Ktor CIO client to call an external service. If the service takes over a certain threshold to respond I want it to fail. Is there any way to do this in the client? I'm currently wrapping the client call with
withTimeout
, but will this handle cleanup properly, will it cancel the in-flight request? (I'm aware of, and using,
connectTimeout
, but I want to timeout on the request as a whole, not just opening a connection.)
e
Hi @obobo,
withTimeout
is the right way to handle it.