4 ms·
I only looked at it for a second or so, but it looks like it's a simple json proxy. You put a webserver with persistent connections on one end (Tornado in the e
by gizmo 13y ago
I only looked at it for a second or so, but it looks like it's a simple json proxy. You put a webserver with persistent connections on one end (Tornado in the example code) and a regular django environment side by side. The web socket requests are translated in to GET/PUT/POST requests, are pushed to django, django responds and the response is pushed to the client.
So from django's point of view there are stateless JSON requests and responses, so django's happy. The python proxy code is a lightweight wrapper that doesn't have to understand any business logic, so that's pretty straightforward as well.
- falcolas 13y agoI see where I was confused; I looked at the actual code itself, not the example where tornado was living and being used. What are the advantages of this over normal AJAX requests, given that it's all using the single request, single response mode of operation (and you can compress/cache AJAX requests/responses, which websockets doesn't support yet).
- mcantelon 13y agoSeems like advantage is skipping network roundtrip to/from client browser. But still seems expensive in terms of cycles.