In my app, I could do cherrypy.engine.publish('triggers', 'indexes',
update_func) and then have a listener listening on the 'triggers'
channel and handle the 'indexes' argument using the 'update_func'. It
is really simple stuff, but it provides a great way to send a message
out of band. For example, the handler for the above scenario, might
make the trigger requests.
My understanding is the WSPB can be used outside of cherrypy, so it
seems worthwhile to look at where the spec or the actual
implementation might be helpful within the scope of Bright Content
and/or generic WSGI apps.
Eric
The WSPB is definitely usable elsewhere. I'm using it to manage services
that have nothing to do with CherryPy or even HTTP such as a showcase
queue messaging system based on Kamaelia. I also use it to manage a
simple XMPP demo again based on Kamaelia [2].
It really helps dealing with:
* having a clear and unified interface to start/stop services
* handling common tasks like shuting down cleanly on Ctrl-C signals,
managing a pid file, making a demon of process, etc.
* ensuring the start/stop behaves similarly cross-platform
- Sylvain
[1] http://trac.defuze.org/browser/oss/bucker/scripts/queue-server.py
[2]
http://trac.defuze.org/browser/oss/headstock/headstock/example/microblog/jabber-service.py