def process_events(self):
        """Processes any events in the queue."""
        for event, args in iter_except(self.event_queue.popleft, IndexError):
            for callback in self.event_callbacks[event]:
                callback(*args)
Processes any events in the queue.