[Web-SIG] Web Site Process Bus

Ian Bicking ianb at colorstudy.com
Mon Jun 25 23:48:34 CEST 2007

Jim Fulton wrote:
>> All 4 lines of it? ;)
>>     subscribers = []
>>     def notify(event):
>>         for subscriber in subscribers:
>>             subscriber(event)
>> Seriously, though, this handles the notification but not the state
>> machine, which I think is critical to the effort. It also doesn't  
>> do any
>> error-handling for misbehaving subscribers, so not all subscribers are
>> guaranteed to run if there's an unhandled error in an earlier
>> subscriber. It also sends all events to all subscribers, instead of
>> partitioning the subscribers.
> Right.  You need a dispatching layer behind this.  The beauty of  
> zope.event is that it puts very little requirement on people who  
> publish events.

The problem is that it relies on some specific dispatching layer, and 
that layer would *also* have to be defined to use this for something 
useful like the start/stop events that are motivating this discussion. 
That is, if you dispatch on "isinstance(event, tuple) and event and 
event[0] == 'some_name'", that's very different than "isinstance(event, 
SomeClass)" or "implements(event, ISomething)" or whatever.  Actual 
servers have to emit something more specific than just "an object".

Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org
             | Write code, do good | http://topp.openplans.org/careers

More information about the Web-SIG mailing list