开发者

Comet on python

I am pretty new to web programming in python.

I am interested to build a chat room on browser. (for prototype). I know django pretty well and have done a bit of twisted in the past.

Then I came across orbited. It's pretty badly documented (I don't think that actually qualifies for documentation anyway), but these terms seems to pop up quite frequently:

  1. Orbited
  2. Twisted
  3. MorbidQ, ActiveQ, and bascially a bunch of MessageQueue technologies

I did a few examples on the orbited website, but they somehow doesn't seem to explain really how everything works together.

My questions are:

  1. I keep seeing http://:9000 on the [listen] directive. According to their main website, "The listen section describes the interfaces and ports Orbited should use to accept browser connections." AFAIK, standard browser uses port 80 to communicate. And I think this port is used for orbited.js to connect to the server for comet techniques? What happens if 8000 is blocked? (like behind most firewall in schools/organizations)

  2. I keep seeing the word proxy. I do not know how an actual proxy fits within this combination of frameworks

  3. The relationship with twisted and orbited. Orbited is built ON TOP OF twisted (if I am not wrong). Then why are there so many examples that discuss using orbited ON TOP of twisted? Why do I need twisted in the first place? Can I use orbited on nginx? (Again, searching for nginx and orbited results in results that have the word proxy in them. How does this 开发者_StackOverflow中文版fit at all?)

  4. With regards to http://anirudhsanjeev.org/tutorialhow-to-django-comet-orbited-stomp-morbidq-jsio/, the author uses an xml-rpc server. Can someone actually explain why? (well he said that "you cannot start up a reactor send/receive system inside your django view", but why do we even need to run a reactor inside that in the first place? Isn't orbited built on top of twisted? Shouldn't it therefore have its own reactor?)

  5. Morbidq describes itself as "Morbid is a STOMP publish/subscribe server with absolutely no potential to cluster. It supports publish/subscribe topics, and runs as a single node." Why do we need this? Doesn't Comet solve something exactly like this? why do I keep seeing tutorials that combine a bunch of technologies that are seemingly similar but really has clear distinction?

  6. All I want to do is to build a simple webchat application. After seeing this, I realize that maybe using orbited and twisted and morbidq and django etc might be too troublesome. (Of course I am planning to make it scalable).

  7. I looked at tornado, it's okay, but kind of small imo in terms of community. It doesn't really do comet except it allows non-blocking connections (I learned this on IRC). Do I really need all the special comet techniques, or will long polling satisfy me? (for a simple web chat application)

  8. What are the big companies using? What's the standard defacto comet framework big companies are applying? (like facebook, gtalk, and twitter?) Are these available in python?

Any help on any question will be appreciated.


Check out Alex Gaynor's PyCon talk on Python and the real-time web.


Well I'm struggling with the same and I think I can answer some questions, for future reference.

1) if the acces to that port is blocked, your website won't be able to communicate with Orbited.

2) proxy is a lot of things, think of it as "redirection", nginx works as a proxy.

3) orbited is built upon twisted, but it starts its own Twisted server. when related to twisted people may talk about their own app built in Twisted instead of Django or others.

4) you can avoid the RPC and put messages in queue right from a Django script through a post/get request, he may wanted to build more... corporative.

5) morbidQ is a queue system. Comet is just a concept. Frameworks are built to solve certain problems, there may be other similar solutions, but not as complete for this situation. I personally replaced morbidQ with rabbitMQ.

6) you are right, the scalability depends more on your coding than the tech you chose.

7) tornado is great. everything considered special has no full browser support, while long polling does.

8) They never opensourced their comet solutions yet. But there is no big deal. I think ruby is more evolved in this matter.

hope it helps future web surfers!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜