[Twisted-Python] Twisted-friendly Message bus
eprparadocs at gmail.com
Fri Jun 16 12:49:23 EDT 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.
Phil Mayers wrote:
> 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.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python