[go-nuts] Idiomatic way of handling http requests in separate goroutines

2016-12-08 Thread Tamás Gulácsi
I think this is not bad. But you can try context.Context, or simply pass in a new chan, which will be closed by the worker - so you can select, timeout on it. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

[go-nuts] Idiomatic way of handling http requests in separate goroutines

2016-12-07 Thread Pablo Rozas Larraondo
Hi gophers, I'm designing a service exposed through a http server which uses a pool of workers to process requests. At the moment my handlerFunc look similar to this: func aHandler(w http.ResponseWriter, r *http.Request) { var wg sync.WaitGroup wg.Add(1) reqQueue <- &Reque