code: def _trigger_event(self, event, *args, **kwargs):
          
          run_async = kwargs.pop('run_async', False)
          if event in self.handlers:
              if run_async:
                  return self.start_background_task(self.handlers[event], *args)
              else:
                  try:
                      return self.handlers[event](*args)
                  except:
                      self.logger.exception(event + ' handler error')
docs: Invoke an event handler.