def METHOD_NAME(self, project_name, sender):
    self._folders_refreshing = True
    self._controller.emit_event(
        "folders.refresh.started",
        {"project_name": project_name, "sender": sender},
        self.event_source
    )
    try:
        yield
    finally:
        self._controller.emit_event(
            "folders.refresh.finished",
            {"project_name": project_name, "sender": sender},
            self.event_source
        )
        self._folders_refreshing = False