[TransWarp] Publish/subscribe and PEAK components

Phillip J. Eby pje at telecommunity.com
Wed Aug 20 22:04:48 EDT 2003


At 03:50 PM 8/20/03 -0700, John Landahl wrote:
>I'd like to get some pointers on where it might be possible to add
>publish/subscribe features to PEAK components.  I have a client/server
>application where the client periodically asks the server for configuration
>information and work.  Ideally I'd like the information exchange part of the
>client to simply dump the data into the right place in the component
>hierarchy and be able to have other parts of the client receive notifications
>(callbacks would be fine) when the components they care about have been
>changed.
>
>Would it make sense to subclass binding.Component to add subscription methods
>and an overridden __setattr__ function to handle the publications?  Or would
>an entirely different approach be necessary?

Offhand, I'd suggest creating an "event service" component that receives 
events and redistributes them.  But, I'd also mention that component 
hierarchies are intended to be "mostly static".  If you are doing 
substantial configuration changes, it's probably simpler to just throw out 
the components and let them be rebuilt from their recipes.  It's not like 
component construction is a very expensive activity, when compared to the 
real work of your application.




More information about the PEAK mailing list