Is there any way to react to a client closing a co...
# ktor
t
Is there any way to react to a client closing a connection? My use case is doing some heavy calculations on request and then sending a small result. I would like to immediately stop the calculations when the client closes the connection.
c
Sometimes you get Cancellation exception in handling coroutines
Unfortunately due to the nature of networking and http you can't get it guaranteed
Some of engines doesn't even provide any events about it
For example there is no simple way to do that with servlets
t
Ok thanks for the info! I will use some explicit notifycation by client in combination with timeouts then.