def __init__(self, maxConcurrentThreads=10): ThreadManager.__init__(self, maxConcurrentThreads) # watch the queue for updates _fd = self.queue_in._reader.fileno() GObject.io_add_watch(_fd, GObject.IO_IN, self._on_cb)
def __init__(self, app=None, maxConcurrentThreads=10): ThreadManager.__init__(self, maxConcurrentThreads) self._app = app if self._app is not None: # watch the queue for updates _fd = self.queue_in._reader.fileno() _notifier = QSocketNotifier(_fd, QSocketNotifier.Read, self._app) _notifier.activated.connect(self._on_cb)