class SynchronizingProcess(Process): def __init__(self): Process.__init__(self) from conductor.lib.bus import SynchronizingBus self.bus = SynchronizingBus() self.bus.subscribe('log', self.log) self.bus.subscribe('main', self.check_children) def check_children(self): if not active_children(): self.bus.log("No more children still running, let's exit the main process") self.bus.unsubscribe('main', self.check_children) self.bus.exit()
class SynchronizingProcess(Process): def __init__(self): Process.__init__(self) from conductor.lib.bus import SynchronizingBus self.bus = SynchronizingBus() self.bus.subscribe('log', self.log) self.bus.subscribe('main', self.check_children) def check_children(self): if not active_children(): self.bus.log( "No more children still running, let's exit the main process") self.bus.unsubscribe('main', self.check_children) self.bus.exit()
def __init__(self): Process.__init__(self) from conductor.lib.bus import SynchronizingBus self.bus = SynchronizingBus() self.bus.subscribe('log', self.log) self.bus.subscribe('main', self.check_children)