Files
@ a5594f90afa6
Branch filter:
Location: CSY/reowolf/src/runtime2/component/component.rs - annotation
a5594f90afa6
971 B
application/rls-services+xml
Fix bug in select statement
93081320c9fa 5babd5401b1e 5babd5401b1e 5babd5401b1e 5babd5401b1e 5babd5401b1e 5babd5401b1e 5babd5401b1e 5babd5401b1e 5babd5401b1e 5babd5401b1e 93081320c9fa 5babd5401b1e 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 93081320c9fa 5babd5401b1e | use crate::protocol::eval::EvalError;
use crate::runtime2::*;
use super::CompCtx;
pub enum CompScheduling {
Immediate,
Requeue,
Sleep,
Exit,
}
/// Generic representation of a component (as viewed by a scheduler).
pub(crate) trait Component {
/// Called if the component is created by another component and the messages
/// are being transferred between the two.
fn adopt_message(&mut self, comp_ctx: &mut CompCtx, message: DataMessage);
/// Called if the component receives a new message. The component is
/// responsible for deciding where that messages goes.
fn handle_message(&mut self, sched_ctx: &mut SchedulerCtx, comp_ctx: &mut CompCtx, message: Message);
/// Called if the component's routine should be executed. The return value
/// can be used to indicate when the routine should be run again.
fn run(&mut self, sched_ctx: &mut SchedulerCtx, comp_ctx: &mut CompCtx) -> Result<CompScheduling, EvalError>;
}
|