Closed gunnxx closed 6 years ago
You will need to have a thread or thread pool that consumes the queue and when one of those queue objects have completed call a lambda inside the route.
It's not quite what you're asking for but you can see what I mean by looking at the second code section here.
So your route needs to return void
and the on_ready
lambda needs to call response::write
to write some data to the response and call response::end
to signal that the response is ready to be sent.
How to send async response for exact certain request?
Later, I will have a thread that consume the queue and run the requested method. How can the thread send back the response to the exact request?