The current version has my first attempt at an event publishing system. Here is an example usage scenario.
#Event example using boduch.event
from boduch.event import Event, publish, subscribe, lock, unlock
from boduch.handle import Handle
class MyHandler(Handle):
def __init__(self, *args, **kw):
Handle.__init__(self, *args, **kw)
def run(self):
print "Got event",self.data["event"]
if __name__=="__main__":
subscribe(Event, MyHandler)
publish(Event)
No comments :
Post a Comment