[Twisted-Python] Twisted-friendly Message bus

Chaz. eprparadocs at gmail.com
Fri Jun 16 10:49:23 MDT 2006


I do it using "named singleton" classes and callbacks. Anyone that wants
to share the queue merely asks for the class to be instantiated. There
are 3 methods - registerCallback, removeCallback and sendEvent. Whatever
arguments, short of a few, are passed to the callback routines. It is
simple and has worked for me.

I have thought about doing something more sophisticated so the message
bus can extend to other machines, but I haven't done that yet.

Chaz

Phil Mayers wrote:
> All,
> 
> I've run into "this service needs to know about this event from this
> other service" once too often. It's message bus time, baby.
> 
> However, many of the daemons I use are locally-written Twisted code, so
> a Twisted-friendly (async api) one would be nice. Note also that other
> non-Twisted code will need to connect to it, so rolling my own (aside
> from it being a bad idea from a NIH perspective) is out.
> 
> I could of course wrap the message queue receiver for something
> well-proven like Spread into a thread. Then there's XMPP which is the
> darling of the anti-Java movement - though wrapping Twisteds' XMPP API
> to get a message bus might be annoying.
> 
> Suggestions?
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 





More information about the Twisted-Python mailing list