-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync handlers #11
Comments
Hello! I think the very idea of Server Sent Events involves asynchrony. So it's not clear how to make it work with sync handler. You have to send some initial headers, keep connection open and then somehow send events which occur later. Async handler was designed for exactly this scenario. |
Hi, Maybe my understanding is incorrect. I thought the async handler in ring is just to make the handling of the operation async - ie Java servelet 3.0. - in this the HTTP server is running in a thread pool, and when it receives a request it hands it over to another thread which handles that particular request. So the server never gets tied up and is always avalaible for request handling. While SSE corresponds to the IO being async - ie servelet 3.1 - in this case the IO itself is served asyncronously in bits and pieces - so websockets and SSE would fit this bill. I am not sure which case is ring implementing. If ring is implementing the first case (which is my understanding), then we dont need an async handler. As I understand in your implementation the async is being provided by go blocks, which park when input is not available. However if ring is implementing the second case, that means the callback function is being called with data whenever it becomes avalaible, and there the async case makes sense. What is your understanding ? Thanks, |
Hi,
But it is failed, the error is :
In this framework,what do i still to do? Thinks very much |
Hi,
I see that the example code requires an async handler. Can it use a sync handler too, or is that a problem ?
Thanks,
Murtaza
The text was updated successfully, but these errors were encountered: