Skip to content
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

Fix SSE endpoint #2

Open
jettify opened this issue Apr 5, 2015 · 3 comments
Open

Fix SSE endpoint #2

jettify opened this issue Apr 5, 2015 · 3 comments

Comments

@jettify
Copy link
Member

jettify commented Apr 5, 2015

Portend sse implementation works like simple polling so easily could be switched to ajax or websokets for message push. Javascript and backend implementation should be fixed.

@jettify jettify added this to the release 0.0.1 milestone Apr 11, 2015
@jettify jettify removed this from the release 0.0.1 milestone May 8, 2015
@iho
Copy link
Contributor

iho commented May 30, 2015

I want help, but I can not understand how it works.
It is looks like it send one request per second to http://127.0.0.1:9000/_debugtoolbar/sse?request_id=313339383833313133303438313638 and get the same data every time.

@jettify
Copy link
Member Author

jettify commented Jun 1, 2015

You are right this SSE work more like regular polling then actual server push. The reason why data is the same because you do not have new request since last poll. Try to refresh page of demo app in separate tab and you will see new data in SSE request.

@Dreamsorcerer
Copy link
Member

I think the /sse endpoint simply closes the connection like a regular request, forcing the client to reopen it: https://github.com/aio-libs/aiohttp-debugtoolbar/blob/master/aiohttp_debugtoolbar/views.py#L156

Instead of switching to websockets, we can probably just fix this endpoint by using aiohttp-sse or something: https://github.com/aio-libs/aiohttp-sse#example

This is probably a simple task and shouldn't require making any changes to the client code.

@Dreamsorcerer Dreamsorcerer changed the title Swich from SSE to Websockets Fix SSE endpoint Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants