def METHOD_NAME(self, event_class: Type[events.TaskEventType], **kwargs) -> events.TaskEventType:
    if self._emit is None:
        raise RuntimeError("Task {self} haven't started yet, so it can't emit")
    return self._emit(event_class, task=self, **kwargs)