def __init__(self, daemon=False): EventEmitter.__init__(self) self._daemon = daemon # the ID won't change when the name changes self._uuid = _new_name()
def __init__(self, maxConcurrentThreads=5): EventEmitter.__init__(self) self._logger = logging.getLogger('Lens.ThreadManager') #stores all threads, running or stopped self.threads = {} self.pendingThreadArgs = [] self.maxConcurrentThreads = maxConcurrentThreads self.queue_in = multiprocessing.Queue()
def on(self, thread, name, callback): EventEmitter.on(self, '__thread_%s_%s' % (thread.uuid, name), callback)