I am working on a chat application in Django, how can I ensure that I
do not have to poll the server for any chat data.
Possible approaches that I've been to:
1. BAD - use polling.
2. Use long polling - bad approach afa browser support is concerned.
3. Using sockets in flash - makes the application flash dependent.
Is there some good way to do this? Or if there is something Django
specific? Something like HTTPBinding or any 3rd party tested libraries?
I am expected to provide support till IE6. :-(
Correct me if I am wrong, flash is available on 95% of the systems, this
approach looks like safest bet, is it good to go?
Btw, how does Gmail and FB chat works?
Thanks
Pretty sure fb uses Erlang for chat.
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
The basic challenge with any chat application is the long polling bit,
django by default isn't really designed to handle that. Other servers
(Tornado, etc.) are much better at handling the long polling cycle that
typical web chat applications require.
I was just finishing an exploration of Django+Tornado -- building a chat
application -- which I've now pushed up to github.
http://github.com/koblas/django-on-tornado
The only "trick" at the moment is that a response that is returned via
the async Tornado handler isn't passed back up the middleware stack,
pondering good ways to deal with that. But in the mean time, here's a
functional chat application to play with if you're interested.
--koblas
@Jeff, Erlang! Pretty surprised to see that.
@Alexander, doesn't work :( - or might be I am not able to get it..
@David, cool I'll try this, but will this work using mod_python / Apache?
@ebry1,
Imagine 10000 people live chatting, that means 10000 requests per
second, but in real world, only 3000 messages might have been
delivered. (as example). Polling will bring your net throughput of the
server to almost one tenth.
@all,
Can you suggest me the side effects of using Sockets via 1x1px flash
applet embedded on the page? Apart from the fact that flash is
required.
Thanks
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>
--
* First is that you'll need to have N-user connections open at a minimum
based on the number of users you have using the system simultaneously.
Thus your memory footprint and performance is going to suffer as the
number of users increases.
* Second - the demo app I have assumes a single process model for
handling communications (e.g. all notification is done via callbacks).
So you would need to build some kind of server who maintains state if
you ran things under apache (multi-process dispatch model).
--david
This looks promising, could you also throw some light on how hosting
friendly this set up will be?
Thanks