fn exec_next(
        mut self,
        exec_env: &dyn ExecutionEnvironment<State = ReplicatedState, CanisterState = CanisterState>,
        time: Time,
        routing_table: Arc<RoutingTable>,
        subnet_records: Arc<BTreeMap<SubnetId, SubnetType>>,
    ) -> ExecResult<(bool, Self)> {
        let mut canister = match self.canisters.pop_front() {
            Some(c) => c,
            None => return EarlyResult::new((true, self)),
        };

        if !canister.has_input() {
            self.finished_canisters.push(canister);
            EarlyResult::new((self.canisters.is_empty(), self))
        } else if self.total_instructions_limit >= self.msg_instructions_limit {
            debug!(
                self.log,
                "Executing message on canister with rank = {}. Round instructions left {}", self.finished_canisters.len(), self.total_instructions_limit;
                messaging.canister_id => canister.canister_id().to_string()
            );
            let msg = canister.pop_input().unwrap();
            let timer = self.metrics.msg_execution_duration.start_timer();
            let res = exec_env.execute_canister_message(
                canister,
                self.msg_instructions_limit,
                msg,
                time,
                routing_table,
                subnet_records,
                self.subnet_available_memory.clone(),
            );
            res.and_then(move |res| {
                let canister = self.on_msg_processed(res);
                if canister.has_input() {
                    self.canisters.push_front(canister);
                } else {
                    self.finished_canisters.push(canister);
                }
                drop(timer);
                (self.canisters.is_empty(), self)
            })
        } else {
            self.interrupted_canisters.push(canister);
            EarlyResult::new((true, self))
        }
    }
// Returns true if the execution on this stream is considered finished
// (there is nothing more to execute or we ran out of instructions).
Returns true if the execution on this stream is considered finished
(there is nothing more to execute or we ran out of instructions).
Returns true if the execution on this stream is considered finished ( there is nothing more to execute or we ran out of instructions ) .
fn exec_next(
        mut self,
        exec_env: &dyn ExecutionEnvironment<State = ReplicatedState, CanisterState = CanisterState>,
        time: Time,
        routing_table: Arc<RoutingTable>,
        subnet_records: Arc<BTreeMap<SubnetId, SubnetType>>,
    ) -> ExecResult<(bool, Self)> {
        let mut canister = match self.canisters.pop_front() {
            Some(c) => c,
            None => return EarlyResult::new((true, self)),
        };
        if !canister.has_input() {
            self.finished_canisters.push(canister);
            EarlyResult::new((self.canisters.is_empty(), self))
        } else if self.total_instructions_limit >= self.msg_instructions_limit {
            debug!(
                self.log,
                "Executing message on canister with rank = {}. Round instructions left {}", self.finished_canisters.len(), self.total_instructions_limit;
                messaging.canister_id => canister.canister_id().to_string()
            );
            let msg = canister.pop_input().unwrap();
            let timer = self.metrics.msg_execution_duration.start_timer();
            let res = exec_env.execute_canister_message(
                canister,
                self.msg_instructions_limit,
                msg,
                time,
                routing_table,
                subnet_records,
                self.subnet_available_memory.clone(),
            );
            res.and_then(move |res| {
                let canister = self.on_msg_processed(res);
                if canister.has_input() {
                    self.canisters.push_front(canister);
                } else {
                    self.finished_canisters.push(canister);
                }
                drop(timer);
                (self.canisters.is_empty(), self)
            })
        } else {
            self.interrupted_canisters.push(canister);
            EarlyResult::new((true, self))
        }
    }
fn exec_next ( mut self , exec_env : & dyn ExecutionEnvironment < State = ReplicatedState , CanisterState = CanisterState > , time : Time , routing_table : Arc < RoutingTable > , subnet_records : Arc < BTreeMap < SubnetId , SubnetType > > , ) -> ExecResult < ( bool , Self ) > { let mut canister = match self . canisters . pop_front ( ) { Some ( c ) => c , None => return EarlyResult :: new ( ( true , self ) ) , } ; if ! canister . has_input ( ) { self . finished_canisters . push ( canister ) ; EarlyResult :: new ( ( self . canisters . is_empty ( ) , self ) ) } else if self . total_instructions_limit >= self . msg_instructions_limit { debug ! ( self log " " self finished_canisters len ( ) self total_instructions_limit messaging canister_id canister canister_id ( ) to_string ( ) ) ; let msg = canister . pop_input ( ) . unwrap ( ) ; let timer = self . metrics . msg_execution_duration . start_timer ( ) ; let res = exec_env . execute_canister_message ( canister , self . msg_instructions_limit , msg , time , routing_table , subnet_records , self . subnet_available_memory . clone ( ) , ) ; res . and_then ( move | res | { let canister = self . on_msg_processed ( res ) ; if canister . has_input ( ) { self . canisters . push_front ( canister ) ; } else { self . finished_canisters . push ( canister ) ; } drop ( timer ) ; ( self . canisters . is_empty ( ) , self ) } ) } else { self . interrupted_canisters . push ( canister ) ; EarlyResult :: new ( ( true , self ) ) } }
Returns true if the execution on this stream is considered finished
(there is nothing more to execute or we ran out of instructions).
Returns true if the execution on this stream is considered finished ( there is nothing more to execute or we ran out of instructions ) .
mut self
exec_env
&dyn ExecutionEnvironment<State = ReplicatedState, CanisterState = CanisterState>
time
Time
routing_table
Arc<RoutingTable>
subnet_records
Arc<BTreeMap<SubnetId, SubnetType>>
mut self
exec_env
&dyn ExecutionEnvironment<State = ReplicatedState, CanisterState = CanisterState>
time
Time
routing_table
Arc<RoutingTable>
subnet_records
Arc<BTreeMap<SubnetId, SubnetType>>