def __init__(self, read_callback, job_callback=None): if job_callback: if available_processors() <= 2 and is_hyperthreading(): self._manager = SimpleManager(read_callback, job_callback) else: self._manager = WorkManager(read_callback, job_callback) else: self._manager = DummyManager(read_callback)
def __init__(self, read_callback,notify_status, job_callback=None): if job_callback: #if available_processors() <= 2:# and is_hyperthreading(): self._manager = SimpleManager(read_callback, job_callback, notify_status) #else: # self._manager = WorkManager(read_callback, # job_callback, # notify_status) else: self._manager = DummyManager(read_callback)
class BufferManagerFactory: def __init__(self, read_callback,notify_status, job_callback=None): if job_callback: #if available_processors() <= 2:# and is_hyperthreading(): self._manager = SimpleManager(read_callback, job_callback, notify_status) #else: # self._manager = WorkManager(read_callback, # job_callback, # notify_status) else: self._manager = DummyManager(read_callback) def start(self): self._manager.start() def join(self): self._manager.join() def put(self, data): self._manager.put(data) def stop(self): self._manager.stop() @property def output_buffer(self): return self._manager.output_buffer
class BufferManagerFactory: def __init__(self, read_callback, job_callback=None): if job_callback: if available_processors() <= 2 and is_hyperthreading(): self._manager = SimpleManager(read_callback, job_callback) else: self._manager = WorkManager(read_callback, job_callback) else: self._manager = DummyManager(read_callback) def start(self): self._manager.start() def join(self): self._manager.join() def put(self, data): self._manager.put(data) def stop(self): self._manager.stop() @property def output_buffer(self): return self._manager.output_buffer
def __init__(self, read_callback, job_callback, notify_status): DummyManager.__init__(self, read_callback) self.job = job_callback self.notify_status = notify_status
def __init__(self, read_callback, job_callback): DummyManager.__init__(self, read_callback) self.job = job_callback