(self)
Invokes each of the events in the queue.

    Thread safe for queue access but not during event invocations.

    This method must be called regularly on the main thread.
Invokes each of the events in the queue.
Invokes each of the events in the queue .
def process_events(self):
    """Invokes each of the events in the queue.

    Thread safe for queue access but not during event invocations.

    This method must be called regularly on the main thread.
    """
    with self._lock:
      # Swap event buffers quickly so that we don't block the input thread for
      # too long.
      events_to_process = self._events
      self._events = []

    # Now that we made the swap, process the received events in our own time.
    for event in events_to_process:
      event()
def process_events ( self ) : with self . _lock : # Swap event buffers quickly so that we don't block the input thread for # too long. events_to_process = self . _events self . _events = [ ] # Now that we made the swap, process the received events in our own time. for event in events_to_process : event ( )