diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index c806614529f4e902549e03aff14271826afe2623..44988824b0ca822a44d4640b61b480ee6eb19ba5 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -287,6 +287,7 @@ pub trait RunContext { fn did_put(&mut self, port: PortId) -> bool; fn get(&mut self, port: PortId) -> Option; // None if still waiting on message fn fires(&mut self, port: PortId) -> Option; // None if not yet branched + fn get_fork(&mut self) -> Option; // None if not yet forked fn get_channel(&mut self) -> Option<(Value, Value)>; // None if not yet prepared } @@ -302,6 +303,7 @@ pub enum RunResult { BranchMissingPortState(PortId), // branch doesn't know about port firing BranchMissingPortValue(PortId), // branch hasn't received message on input port yet BranchAtSyncEnd, + BranchFork, BranchPut(PortId, ValueGroup), } @@ -329,6 +331,8 @@ impl ComponentState { return RR::NewComponent(definition_id, monomorph_idx, args), EC::NewChannel => return RR::NewChannel, + EC::NewFork => + return RR::BranchFork, EC::BlockFires(port_id) => return RR::BranchMissingPortState(port_id), EC::BlockGet(port_id) => return RR::BranchMissingPortValue(port_id), EC::Put(port_id, value) => { @@ -398,6 +402,7 @@ impl ComponentState { // to the runtime unreachable!(); }, + EvalContinuation::NewFork => unreachable!(), // Outside synchronous blocks, no fires/get/put happens EvalContinuation::BlockFires(_) => unreachable!(), EvalContinuation::BlockGet(_) => unreachable!(), @@ -431,6 +436,7 @@ impl ComponentState { // Not possible to create component in sync block EvalContinuation::NewComponent(_, _, _) => unreachable!(), EvalContinuation::NewChannel => unreachable!(), + EvalContinuation::NewFork => unreachable!(), EvalContinuation::BlockFires(port) => { return SyncBlocker::CouldntCheckFiring(port); }, @@ -524,6 +530,11 @@ impl RunContext for EvalContext<'_> { EvalContext::Sync(_) => unreachable!(), } } + + fn get_fork(&mut self) -> Option { + // Never actually used in the old runtime + return None; + } } // TODO: @remove once old runtime has disappeared