What's the best dispatcher/callback library in Python?

I need to allow other Python applications to register callback functions for events in my application. These need to have priorities associated with them (so a callback with a priority of 10 runs before a callback with a priority of 1) and callback functions need to be able to signal errors to the dispatcher.

These are all lightweight callbacks running in the same process, so I don't need to send signals across process boundaries.

Is there a good Python library to handle this, or do I need to write my own?

Answers


Are these other applications running in another address space? If so, you'll need to use an interprocess communication library like D-BUS.

If you're just sending signals in the same process, try PyDispatcher


Need Your Help

Separate XML attributes in PHP

php xml table simplexml

I'm getting the XML attributes for sky_condition from this XML file:

Go check if string in slices of string

go

As a preface I'm coming from python, where I would have a list with my values instead of string slices and do "if x in list". Please tell me if I'm doing this wrong.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.