unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.45k stars 688 forks source link

Improve api for uwsgi WebSockets #1717

Open danidee10 opened 6 years ago

danidee10 commented 6 years ago

Straight from the docs for uwsgi.websocket_recv:

This is the real core of the whole implementation.

This function actually lies about its real purpose. It does return a websocket message, but it really also holds the connection opened (using the ping/pong subsystem) and monitors the stream’s status.

The function/logic for holding the connection open should be moved to another method. I propose something like:

uwsgi.websocket_ping_pong

Why ?

I don't know much about the uWSGI core but if this issue is considered i would be glad to work with the core devs in implementing this.

unbit commented 6 years ago

Hi @danidee10 the websocket api is the same since 2014, so i think it requires a bit of work :)

If you want to take the task i will be happy to review it. Avoid asyncio in your tests as i am working on a brand new implementation (that probably requires months to be useful...), but gevent and multithreading are absolutely the most common scenario.

danidee10 commented 6 years ago

Okay @unbit Let me get my hands dirty and see what i can do.

I'll probably need to join the #IRC Channel