CherryPy WSPB and Web Triggers

4 views
Skip to first unread message

Eric Larson

unread,
Jul 16, 2008, 1:46:23 PM7/16/08
to brightcontent
CherryPy 3.1 brings about Web Server Process Bus, which is a standard
way to manage a cherrypy server (WSGI or otherwise) using a simple
message bus. The nice aspect of this is that the bus is usable outside
of the scope of simple server management. The obvious real world
example of using the message bus is the file reloader. When a
registered file changes, the server is reloaded by sending a reload
message to the bus where a listener restarts the server. The more
interesting usage is in providing a simple background processing
model.

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

Sylvain Hellegouarch

unread,
Jul 16, 2008, 2:09:12 PM7/16/08
to bright...@googlegroups.com
Eric Larson a écrit :

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


Reply all
Reply to author
Forward
0 new messages