Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
 def __init__(self, read_callback, job_callback, notify_status):
     DummyManager.__init__(self, read_callback)
     self.job = job_callback
     self.notify_status = notify_status
Esempio n. 6
0
 def __init__(self, read_callback, job_callback):
     DummyManager.__init__(self, read_callback)
     self.job = job_callback
Esempio n. 7
0
 def __init__(self, read_callback, job_callback):
     DummyManager.__init__(self, read_callback)
     self.job = job_callback