clustershell
clustershell copied to clipboard
Multi EventHandler support for Worker
In order to improve API and Task code, it could be nice to have support for multiple handlers per workers.
This could be simply done using an event handler list per worker.
worker.handlers = []
And iterate over these handlers when triggering events.
If necessary, a simple compatibility mode for worker.handler could be implemented thanks to a property:
@property
def handler(self):
return self.handlers[0]
This will help us implement featurefull handlers like GatherEventHandler or MsgTreeHandler and use them directly inside Task instead of having this Task specific hacking code for managing MsgTree. This will help reduce Task code.