def __init__(self, limit=None, preload=None): self.limit = limit self.preload = preload or 0 self._resource = _Queue() self._dirty = set() self.setup()
def __init__(self, receiver, notifications_callback): super(EventsListener, self).__init__(name=self.__class__.__name__ + ':' + receiver.path.split('/')[2]) self.daemon = True self._active = False self.receiver = receiver self._queued_notifications = _Queue(16) self._notifications_callback = notifications_callback
def __init__(self, drain_events): self.drain_events = drain_events self.inbound = _Queue() self.mutex = Lock() self.poll_request = Condition(self.mutex) self.shutdown = Event() self.stopped = Event() self._on_collect = Finalize(self, self.close) Thread.__init__(self) self.setDaemon(False) self.started = False
def __init__(self, receiver, notifications_callback): super(EventsListener, self).__init__(name=self.__class__.__name__) # replace the handle with a threaded one receiver.handle = _ThreadedHandle(self, receiver.path, receiver.handle) self.daemon = True self._active = False self.receiver = receiver self._queued_notifications = _Queue(16) self._notifications_callback = notifications_callback self.tick_period = 0
def _new_queue(self, key): self.queues[key] = _Queue()
def init_queue(split_text): queue = _Queue() first_window = get_first_window(split_text) for word in first_window[1:]: queue.put(word) return queue
def _init_queue(split_text): queue = _Queue() first_window = _get_first_window(split_text) for word in first_window[1:]: queue.put(word) return queue
def __init__(self, name): super(TaskRunner, self).__init__(name=name) self.daemon = True self.queue = _Queue(16) self.alive = False
def __init__(self, name='queue'): self._q = _Queue(0) self._senitel = type('SenitelTuple', (tuple,), {}) self._stopped = False self._name = name
def _create(name, _global_queue_cache={}): if name not in _global_queue_cache: _global_queue_cache[name] = _Queue() return _global_queue_cache[name]
from __future__ import absolute_import, division, print_function, unicode_literals from gi.repository import Gtk, GLib from logitech.unifying_receiver import settings as _settings # # # try: from Queue import Queue as _Queue except ImportError: from queue import Queue as _Queue _apply_queue = _Queue(4) def _process_apply_queue(): def _write_start(sbox): _, failed, spinner, control = sbox.get_children() control.set_sensitive(False) failed.set_visible(False) spinner.set_visible(True) spinner.start() while True: task = _apply_queue.get() assert isinstance(task, tuple) # print ("task", *task) if task[0] == 'write': _, setting, value, sbox = task