I want to put all arriving http.Request
s into a queue and have a separate thread (goroutine
?) process these requests and return the appropriate status.
However, the main http request
handler directly completes the request even when the http.Request
object is sent asynchronously to a goroutine
.
Is there a way to control when the http.Request
is completed and thereby asynchronously process it?
[Update]
I want to implement a producer-consumer model. The main request handler produces the requests and put them into a queue. A consumer thread (or threads) will read these requests, consume the body of the requests and return them.