catch client timeouts and cancellations

39 views
Skip to first unread message

Ali Riza KELES

unread,
Nov 14, 2019, 12:32:02 PM11/14/19
to Gorilla web toolkit
Hi,

I have a question. I searched but I couldn't find an answer.

Here's my use case:  One of my handlers awaits client for a long time. This is not something unintended, this is how we want app works. And as a result of being awaited too long, sometimes client timeouts or cancellations occur. I want to catch these client timeouts or client cancellations to do some extra work.


It seems useful and worth to try, but before implementing something, I just wanted to ask community if there is a convenient way to do that.

Is it possible to catch them? Does gorilla mux provide any interfaces to do that?

Thanks.

-
Ali

Matt S

unread,
Nov 14, 2019, 12:47:29 PM11/14/19
to goril...@googlegroups.com
What do you want to do - can you share a scenario?

--
You received this message because you are subscribed to the Google Groups "Gorilla web toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gorilla-web...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gorilla-web/68172439-5805-45d3-bf75-eb6796cdf549%40googlegroups.com.

Ali Rıza KELEŞ

unread,
Nov 15, 2019, 11:33:28 AM11/15/19
to goril...@googlegroups.com
Hi Matt,

On Thu, 14 Nov 2019 at 17:47, Matt S <elit...@gmail.com> wrote:
> What do you want to do - can you share a scenario?

If a client (another service) cancels the request (either
intentionally or a client timeout), on server side I want to stop
current running job and next lines of handler code and push some data
to somewhere. Basically, I want to change the flow of my app according
to client cancels or timeouts.

Thank you,

-
Ali Riza
Reply all
Reply to author
Forward
0 new messages