Hello,

I have an HTTP server providing heavy algorithms. Sometimes, the clients 
closes the connection prematurely, before the end of computing.

Note : Sometimes the client consuming these algorithms want to stop the 
process if the solution is not found before X minutes for example.

This article : 
https://gianarb.it/blog/go-http-cleanup-http-connection-terminated
shows how to use the "http.CloseNotifier" chan to receive the signal about 
the premature end of connection.

*However*,

The algorithm is made of several thousands of lines, called proceduraly, 
and sometimes even calling parallel computing on goroutines and recursive 
functions.

It means that I should share the chan everywhere, to every functions or 
almost, insert a boilerplate of channel check frequently in the algorithm, 
and make an exit if needed.

It seems to me pretty awful. Am I missing something ?


Thanks a lot,

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ad1221ad-0ac6-4282-a708-20ab8d49fa5co%40googlegroups.com.

Reply via email to