diff --git a/src/runtime2/component/component_pdl.rs b/src/runtime2/component/component_pdl.rs index f38875e2ea0a113a9f4d5dcda5cc35f60ca5ae43..123fb16ec9f429712a6b766f9f0c5364fb7a09a4 100644 --- a/src/runtime2/component/component_pdl.rs +++ b/src/runtime2/component/component_pdl.rs @@ -481,45 +481,6 @@ impl CompPDL { return Ok(step_result) } - fn handle_sync_start(&mut self, sched_ctx: &SchedulerCtx, comp_ctx: &mut CompCtx) { - sched_ctx.log("Component starting sync mode"); - self.consensus.notify_sync_start(comp_ctx); - for message in self.inbox_main.iter() { - if let Some(message) = message { - self.consensus.handle_incoming_data_message(comp_ctx, message); - } - } - debug_assert_eq!(self.exec_state.mode, CompMode::NonSync); - self.exec_state.mode = CompMode::Sync; - } - - fn handle_component_exit(&mut self, sched_ctx: &SchedulerCtx, comp_ctx: &mut CompCtx) { - sched_ctx.log(&format!("Component exiting (reason: {:?}", self.exec_state.exit_reason)); - debug_assert_eq!(self.exec_state.mode, CompMode::StartExit); - self.exec_state.mode = CompMode::BusyExit; - let exit_inside_sync = self.exec_state.exit_reason.is_in_sync(); - - // Doing this by index, then retrieving the handle is a bit rediculous, - // but Rust is being Rust with its borrowing rules. - for port_index in 0..comp_ctx.num_ports() { - let port = comp_ctx.get_port_by_index_mut(port_index); - if port.state == PortState::Closed { - // Already closed, or in the process of being closed - continue; - } - - // Mark as closed - let port_id = port.self_id; - port.state = PortState::Closed; - - // Notify peer of closing - let port_handle = comp_ctx.get_port_handle(port_id); - let (peer, message) = self.control.initiate_port_closing(port_handle, exit_inside_sync, comp_ctx); - let peer_info = comp_ctx.get_peer(peer); - peer_info.handle.send_message(&sched_ctx.runtime, Message::Control(message), true); - } - } - // ------------------------------------------------------------------------- // Handling messages // -------------------------------------------------------------------------