diff --git a/src/runtime2/connector.rs b/src/runtime2/connector.rs index 47ddc84473aeb08641da02f3cb67ff2b56f388e2..5769144ca08a4f4f213f7b21801117d11f3cf8da 100644 --- a/src/runtime2/connector.rs +++ b/src/runtime2/connector.rs @@ -4,21 +4,22 @@ use std::sync::atomic::AtomicBool; use crate::{PortId, ProtocolDescription}; use crate::protocol::{ComponentState, RunContext, RunResult}; use crate::protocol::eval::{Prompt, Value, ValueGroup}; -use crate::runtime2::inbox::{Message, MessageContents, SolutionMessage}; -use crate::runtime2::native::Connector; -use crate::runtime2::port::{Port, PortKind}; -use crate::runtime2::scheduler::ConnectorCtx; -use super::global_store::ConnectorId; + +use super::ConnectorId; +use super::native::Connector; +use super::scheduler::ConnectorCtx; use super::inbox::{ - PrivateInbox, PublicInbox, DataMessage, SyncMessage, + PrivateInbox, PublicInbox, + DataMessage, SyncMessage, SolutionMessage, Message, MessageContents, SyncBranchConstraint, SyncConnectorSolution }; -use super::port::PortIdLocal; +use super::port::{Port, PortKind, PortIdLocal}; /// Represents the identifier of a branch (the index within its container). An /// ID of `0` generally means "no branch" (e.g. no parent, or a port did not /// yet receive anything from any branch). -#[derive(Clone, Copy, PartialEq, Eq)] +// TODO: Remove Debug derive +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct BranchId { pub index: u32, } @@ -909,7 +910,7 @@ impl ConnectorPDL { // Need to wait until all children are terminated // TODO: Think about how to do this? branch.sync_state = SpeculativeState::Finished; - return ConnectorScheduling::NotNow; + return ConnectorScheduling::Exit; }, RunResult::ComponentAtSyncStart => { // Prepare for sync execution and reschedule immediately @@ -1312,6 +1313,7 @@ pub(crate) enum ConnectorScheduling { Immediate, // Run again, immediately Later, // Schedule for running, at some later point in time NotNow, // Do not reschedule for running + Exit, // Connector has exited } /// Recursively goes through the value group, attempting to find ports.