def METHOD_NAME(self, event_type: str, fl_ctx: FLContext):
    engine = fl_ctx.get_engine()
    if event_type == EventType.START_RUN:
        job_id = fl_ctx.get_job_id()
        pipe: Pipe = engine.get_component(self.pipe_id)
        if not isinstance(pipe, Pipe):
            raise TypeError(f"pipe must be Pipe type. Got: {type(pipe)}")
        pipe.open(name=job_id)
        self.pipe_handler = PipeHandler(pipe)
        self.pipe_handler.start()
    elif event_type == EventType.END_RUN:
        # tell T2 system to end run
        self.log_info(fl_ctx, "END_RUN received - telling T2 to stop")
        self.pipe_handler.notify_end("END_RUN received")
        self.pipe_handler.stop()