code: def _flush_events(self):
          
          if self._sink is not None:
              for event in self._pending_events:
                  self._sink.receive(event)
          self._pending_events = []
docs: ! @brief Send all pending events to event sink.