Documentation for pulsar 0.7.2. For development docs, go here.
The code for this example is located in the examples.chat.manage module.
This example is web-based chat application which exposes three different wsgi routers:
To run the server:
and open web browsers at http://localhost:8060
To send messages from the JSON RPC open a python shell and:
>>> from pulsar.apps import rpc >>> p = rpc.JsonProxy('http://127.0.0.1:8060/rpc', force_sync=True) >>> p.message('Hi from rpc') 'OK'
This example uses the pulsar Publish/Subscribe handler to synchronise messages in a multiprocessing web server.
The websocket handler (pulsar.apps.ws.WS) managing the chat application.
When a new message arrives, it publishes to all listening clients.
Publish a message via JSON-RPC
This is the wsgi application for this web-chat example.
Called once only to setup the WSGI application handler.
Check lazy wsgi handler section for further information.
It creates a publish/subscribe handler and subscribe it to the webchat channel.
Get the config object from the actor serving the webchat.