diff --git a/src/runtime2/component/component.rs b/src/runtime2/component/component.rs index a18a96f7a77b3b69cd72e287478626649fb3b423..828421de9704ad6aa50d13a770b5ba0fe6984cbd 100644 --- a/src/runtime2/component/component.rs +++ b/src/runtime2/component/component.rs @@ -3,9 +3,10 @@ use crate::protocol::*; use crate::runtime2::*; use crate::runtime2::communication::*; -use super::{CompCtx, CompPDL}; +use super::{CompCtx, CompPDL, CompId}; use super::component_context::*; use super::component_random::*; +use super::component_internet::*; use super::control_layer::*; use super::consensus::*; @@ -19,7 +20,7 @@ pub enum CompScheduling { /// Generic representation of a component (as viewed by a scheduler). pub(crate) trait Component { /// Called upon the creation of the component. - fn on_creation(&mut self, sched_ctx: &SchedulerCtx); + fn on_creation(&mut self, comp_id: CompId, sched_ctx: &SchedulerCtx); /// Called if the component is created by another component and the messages /// are being transferred between the two. @@ -116,8 +117,9 @@ pub(crate) fn create_component( if definition.source.is_builtin() { // Builtin component - let component = match definition.source { + let component: Box = match definition.source { ProcedureSource::CompRandomU32 => Box::new(ComponentRandomU32::new(arguments)), + ProcedureSource::CompTcpClient => Box::new(ComponentTcpClient::new(arguments)), _ => unreachable!(), };