[Twisted-Python] Implementing an event manager in twisted

Justin Warren daedalus at eigenmagic.com
Wed Apr 11 20:26:51 EDT 2007


Hi folks,

I have had an idea to implement an event manager to glue a few different
system components together, and I am wondering which pieces of twisted
would be best suited to the task, or even if I should attempt it at all.

I have programs that poll for data.
I have a database that stores polled information.
I have programs that listen for data to be provided to them from
external entities.

I have a desire to provide scheduler functionality (at time x, take
action y).

It seems to me that I could join all of these things via an event
manager:

A program polls for data, succeeds and notifies the event manager of the
data that was polled. The event manager notifies a 'poll storage' object
that stores the data in the database. It could also notify other things.

Data is received from an external entity by a listener. The listener
notifies the event manager of the data. The event manager notifies an
object that stores it in the database, or runs a script, or uploads
something to flickr, or whatever.

Time passes. The event manager notifies interested objects that this is
so. They take whatever action they deem necessary.

None of this is new, so I wonder what others have done in this area? Am
I heading down a dangerous path? What are the traps for new players? Has
someone already written something that does all of this that I can use,
saving myself time and headaches?

-- 
Justin Warren <daedalus at eigenmagic.com>




More information about the Twisted-Python mailing list