|
RealTimeMessaging
Real-time messaging example.
Real-time messaging ExampleThis 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. 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. CherryPyUse CherryPy web framework and WSGI to serve the example with the following command: python streaming/python/cp_server.py TwistedUse 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. TornadoUse 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. |
the tornado example should be messaging.html not streaming.html
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.
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?