On 11 May 2015 at 21:01, Mikko Ohtamaa <[email protected]> wrote:

>
> Especially the b) part is still open question what comes to mixing in
> traditional WSGI with websockets.
>

So this is how it goes.

* uwsgi.websocket_handshake() sends downstream HTTP 101 Switch Protocols
response and you can call this inside your view

* After that you can take over the current uWSGI process/thread as a
websocket event loop

* You need combine uwsgi.websocket_recv_nb() with any other event you might
be running

* There is still some crude parts like getting "Response headers already
send" error now and then when the message loop terminates, but here is the
full answer:

http://stackoverflow.com/a/30198253/315168




>
> All examples I found are "websocket only" applications and do not seem to
> concern with old fashioned HTTP views.
>
> Or is this even possible and do I need to route all "websocket-like" HTTP
> requests to the websocket WSGI application in the first place.
>
> For me the scalability and performance is not an issue, but making the
> implementation as simple as possible. So using things like threads is ok,
> it doesn't have to be super asynchronous. Also using Python 3.
>
> Thank you for the replies.
>
> --
> Mikko Ohtamaa
> http://opensourcehacker.com
> http://twitter.com/moo9000
>
>


-- 
Mikko Ohtamaa
http://opensourcehacker.com
http://twitter.com/moo9000
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to