Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Allow async request handlers #56

Open
DEGoodmanWilson opened this issue Mar 26, 2018 · 1 comment
Open

Allow async request handlers #56

DEGoodmanWilson opened this issue Mar 26, 2018 · 1 comment

Comments

@DEGoodmanWilson
Copy link
Owner

Don’t force a request handler to return synchronously. Slow them to work async. This should be possible with MHD

@DEGoodmanWilson
Copy link
Owner Author

This would require some serious re-engineering of server::server_impl::access_handler_callback_. RIght now, that function calls the request handlers provided by the end developer syncronously, passes that result to a response_renderer object that then invokes MHD_create_response_from_buffer. All well and good.

But to add async support we need to extend the request handler API to include functions for queuing up data. Then, rather than invoking the request handler synchronously, we invoke it in a separate thread. We then take data created by the object and queue it up in a thread-safe FIFO queue, and read that queue from a callback invoked by MHD_create_response_from_callback.

This is a difficult thing to do well, but I think quite important.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant