My favorites | Sign in
Project Home Wiki Issues Source
Search
for
RealTimeMessaging  
Real-time messaging example.
Updated Sep 23, 2009 by dthomp...@gmail.com

Real-time messaging Example

This example demonstrates using Producer/Consumer messaging with an HTTP streaming channel to achieve real-time messaging. The application displays a circular object. A 'master' client can drag the object around the screen, and the movements of the object will be replicated to all other subscribed clients.

Example demo

The example is located in SVN within the examples/streaming directory

The example has scripts for serving the application via CherryPy, Twisted Web, and Tornado.

Start the server and open two browser windows to http://localhost:8000

Click the 'Subscribe' button to start receiving messages.

When the 'master' client drags the yellow circle around the screen, the new position of the circle object will be replicated to all other subscribed clients.

Click the 'Master' button to become the master client.

If you change the messaging url, you must un-subscribe and re-subscribe to start receiving messages from the new url.

CherryPy

Use CherryPy web framework and WSGI to serve the example with the following command:

python streaming/python/cp_server.py

Twisted

Use Twisted web framework to serve the example with the following command:

twistd -noy streaming/python/twisted_server.tac

Point your browser to: http://localhost:8000/streaming.html.

Tornado

Use Facebook's Tornado web framework to serve the example with the following command:

python streaming/python/tornado_server.py

Point your browser to: http://localhost:8000/static/streaming.html.

Comment by thegolef...@gmail.com, Sep 22, 2009

the tornado example should be messaging.html not streaming.html

Comment by project member dthomp...@gmail.com, Sep 23, 2009

The correct url is streaming.html, I listed the wrong directory path.

The directory path for this example is: streaming/python/tornado_server.py

The page has been updated with the correct paths.

Comment by moonspir...@gmail.com, Jun 5, 2011

I don't see any special code in examples/streaming(svn). will this example work as expected? After a short test, the mast ball moved, but nothing happens to the slave balls. (Tested with tornado1.2.1 and twisted 11.0)

Anyone who get this demo running successfully?


Sign in to add a comment
Powered by Google Project Hosting