How should I implement reverse AJAX in a Django application?
Asked Answered
T

3

6

How should I implement reverse AJAX when building a chat application in Django? I've looked at Django-Orbited, and from my understanding, this puts a comet server in front of the HTTP server. This seems fine if I'm just running the Django development server, but how does this work when I start running the application from mod_wsgi? How does having the orbited server handling every request scale? Is this the correct approach?

I've looked at another approach (long polling) that seems like it would work, although I'm not sure what all would be involved. Would the client request a page that would live in its own thread, so as not to block the rest of the application? Would it even block? Wouldn't the script requested by the client have to continuously poll for information?

Which of the approaches is more proper? Which is more portable, scalable, sane, etc? Are there other good approaches to this (aside from the client polling for messages) that I have overlooked?

Tempered answered 13/5, 2010 at 1:34 Comment(0)
M
1

How about using the awesome nginx push module?

Mills answered 13/5, 2010 at 15:13 Comment(1)
How did you end up proceeding with this then?Leonteen
O
1

Have take a look at Tornado?

Using WSGI for comet/long-polling apps is not a good choice because don't support non-blocking requests.

Orthoclase answered 13/5, 2010 at 8:12 Comment(0)
M
1

How about using the awesome nginx push module?

Mills answered 13/5, 2010 at 15:13 Comment(1)
How did you end up proceeding with this then?Leonteen
C
0

The Nginx Push Stream Module provides a simple HTTP interface for both the server and the client.

The Nginx HTTP Push Module is similar, but seems to no longer be maintained.

Confluent answered 21/3, 2012 at 9:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.