diff --git a/src/runtime2/mod.rs b/src/runtime2/mod.rs index af4373aca8c049f02a7d7bb0d07ba639819c9714..407fda0c76334eef9db7b1877ea42873d4b00045 100644 --- a/src/runtime2/mod.rs +++ b/src/runtime2/mod.rs @@ -1,18 +1,14 @@ // Structure of module -mod runtime; -mod messages; -// mod connector; mod branch; mod native; mod port; mod scheduler; -// mod inbox; mod consensus; -mod inbox2; +mod inbox; #[cfg(test)] mod tests; -mod connector2; +mod connector; // Imports @@ -24,10 +20,10 @@ use std::thread::{self, JoinHandle}; use crate::collections::RawVec; use crate::ProtocolDescription; -use connector2::{ConnectorPDL, ConnectorPublic, ConnectorScheduling}; -use scheduler::{Scheduler, ComponentCtxFancy, SchedulerCtx, ControlMessageHandler}; +use connector::{ConnectorPDL, ConnectorPublic, ConnectorScheduling}; +use scheduler::{Scheduler, ComponentCtx, SchedulerCtx, ControlMessageHandler}; use native::{Connector, ConnectorApplication, ApplicationInterface}; -use inbox2::MessageFancy; +use inbox::Message; use port::{ChannelId, Port, PortState}; /// A kind of token that, once obtained, allows mutable access to a connector. @@ -81,7 +77,7 @@ pub(crate) enum ConnectorVariant { } impl Connector for ConnectorVariant { - fn run(&mut self, scheduler_ctx: SchedulerCtx, comp_ctx: &mut ComponentCtxFancy) -> ConnectorScheduling { + fn run(&mut self, scheduler_ctx: SchedulerCtx, comp_ctx: &mut ComponentCtx) -> ConnectorScheduling { match self { ConnectorVariant::UserDefined(c) => c.run(scheduler_ctx, comp_ctx), ConnectorVariant::Native(c) => c.run(scheduler_ctx, comp_ctx), @@ -91,7 +87,7 @@ impl Connector for ConnectorVariant { pub(crate) struct ScheduledConnector { pub connector: ConnectorVariant, // access by connector - pub ctx_fancy: ComponentCtxFancy, + pub ctx_fancy: ComponentCtx, pub public: ConnectorPublic, // accessible by all schedulers and connectors pub router: ControlMessageHandler, pub shutting_down: bool, @@ -246,7 +242,7 @@ impl RuntimeInner { /// Sends a message to a particular connector. If the connector happened to /// be sleeping then it will be scheduled for execution. - pub(crate) fn send_message(&self, target_id: ConnectorId, message: MessageFancy) { + pub(crate) fn send_message(&self, target_id: ConnectorId, message: Message) { let target = self.get_component_public(target_id); target.inbox.insert_message(message); @@ -412,7 +408,7 @@ impl ConnectorStore { fn create(&mut self, connector: ConnectorVariant, initially_sleeping: bool) -> ConnectorKey { let mut connector = ScheduledConnector { connector, - ctx_fancy: ComponentCtxFancy::new_empty(), + ctx_fancy: ComponentCtx::new_empty(), public: ConnectorPublic::new(initially_sleeping), router: ControlMessageHandler::new(), shutting_down: false,