clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

Multi EventHandler support for Worker

Open degremont opened this issue 8 years ago • 0 comments

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.

degremont avatar Nov 13 '17 00:11 degremont