diff --git a/src/runtime2/inbox2.rs b/src/runtime2/inbox2.rs index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d07e95d6839724f9c0b4ae5066a4c42688dc893b 100644 --- a/src/runtime2/inbox2.rs +++ b/src/runtime2/inbox2.rs @@ -0,0 +1,64 @@ +use crate::protocol::eval::ValueGroup; +use crate::runtime2::branch::BranchId; +use crate::runtime2::ConnectorId; +use crate::runtime2::port::PortIdLocal; + +#[derive(Copy, Clone)] +pub(crate) struct PortAnnotation { + pub port_id: PortIdLocal, + pub registered_id: Option, + pub expected_firing: Option, +} + +/// The header added by the synchronization algorithm to all. +pub(crate) struct SyncHeader { + pub sending_component_id: ConnectorId, + pub highest_component_id: ConnectorId, +} + +/// The header added to data messages +pub(crate) struct DataHeader { + pub expected_mapping: Vec, + pub target_port: PortIdLocal, + pub new_mapping: BranchId, +} + +/// A data message is a message that is intended for the receiver's PDL code, +/// but will also be handled by the consensus algrorithm +pub(crate) struct DataMessageFancy { + pub sync_header: SyncHeader, + pub data_header: DataHeader, + pub content: ValueGroup, +} + +pub(crate) enum SyncContent { + +} + +/// A sync message is a message that is intended only for the consensus +/// algorithm. +pub(crate) struct SyncMessageFancy { + pub sync_header: SyncHeader, + pub content: SyncContent, +} + +/// A control message is a message intended for the scheduler that is executing +/// a component. +pub(crate) struct ControlMessageFancy { + pub id: u32, // generic identifier, used to match request to response + pub content: ControlContent, +} + +pub(crate) enum ControlContent { + PortPeerChanged(PortIdLocal, ConnectorId), + CloseChannel(PortIdLocal), + Ack, + Ping, +} + +/// Combination of data message and control messages. +pub(crate) enum MessageFancy { + Data(DataMessageFancy), + Sync(SyncMessageFancy), + Control(ControlMessageFancy), +} \ No newline at end of file