Esempio n. 1
0
    def __init__(self, limit=None, preload=None):
        self.limit = limit
        self.preload = preload or 0

        self._resource = _Queue()
        self._dirty = set()
        self.setup()
Esempio n. 2
0
    def __init__(self, limit=None, preload=None):
        self.limit = limit
        self.preload = preload or 0

        self._resource = _Queue()
        self._dirty = set()
        self.setup()
Esempio n. 3
0
	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
Esempio n. 4
0
    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
Esempio n. 5
0
    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
Esempio n. 6
0
    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
Esempio n. 7
0
	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()
Esempio n. 9
0
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
Esempio n. 10
0
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
Esempio n. 11
0
 def __init__(self, name):
     super(TaskRunner, self).__init__(name=name)
     self.daemon = True
     self.queue = _Queue(16)
     self.alive = False
 def _new_queue(self, key):
     self.queues[key] = _Queue()
Esempio n. 13
0
 def __init__(self, name):
     super(TaskRunner, self).__init__(name=name)
     self.daemon = True
     self.queue = _Queue(16)
     self.alive = False
Esempio n. 14
0
 def __init__(self, name='queue'):
     self._q = _Queue(0)
     self._senitel = type('SenitelTuple', (tuple,), {})
     self._stopped = False
     self._name = name
Esempio n. 15
0
def _create(name, _global_queue_cache={}):
    if name not in _global_queue_cache:
        _global_queue_cache[name] = _Queue()
    return _global_queue_cache[name]
Esempio n. 16
0
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