Now registar(), unregister() and once() procman.ProcessManager's methods
returns the ProcessInfo instance just created/removed.
log.debug(u'ProcessManager.register(%s, %s, %s, %s, %s, %s, %s)',
name, command, callback, persist, max_errors, args, kwargs)
assert not self.has(name)
log.debug(u'ProcessManager.register(%s, %s, %s, %s, %s, %s, %s)',
name, command, callback, persist, max_errors, args, kwargs)
assert not self.has(name)
- self.services[name] = ProcessInfo(name, command, callback, persist,
- max_errors, args, kwargs)
+ pi = ProcessInfo(name, command, callback, persist, max_errors,
+ args, kwargs)
+ self.services[name] = pi
+ return pi
def unregister(self, name):
log.debug(u'ProcessManager.unregister(%s)', name)
def unregister(self, name):
log.debug(u'ProcessManager.unregister(%s)', name)
+ pi = self.services[name]
def _call(self, pi):
pi.start()
def _call(self, pi):
pi.start()
pi = ProcessInfo(name, command, callback, persist, max_errors,
args, kwargs)
self._call(pi)
pi = ProcessInfo(name, command, callback, persist, max_errors,
args, kwargs)
self._call(pi)
def start(self, name):
log.debug(u'ProcessManager.start(%s)', name)
def start(self, name):
log.debug(u'ProcessManager.start(%s)', name)