minivac
06/03/2025, 2:08 PMconfigure = ...
in this case to detect when the client dropped the channel, it no longer exists in ktor 3. Is there an equivalent? was it moved?
embeddedServer(Netty, port = 8080, host = "0.0.0.0", configure = {
channelPipelineConfig = {
addLast("cancellationDetector", AbortableRequestHandler())
}
}) {
configureRouting()
}.start(wait = true)
minivac
06/03/2025, 2:16 PMminivac
06/03/2025, 3:36 PMminivac
06/03/2025, 3:39 PMcall.respondText {
GlobalScope.launch { sendPingOrCloseScope() }
someFlow.collect { sendStuff() }
}
It's not very elegant to depend on a ChannelClosedException
from the ping when the flow is busy, but there seems no way to actually check for call "liveness"