fn pop_canister_input(&mut self, input_queue: InputQueueType) -> Option<RequestOrResponse> {
        let input_schedule = match input_queue {
            InputQueueType::LocalSubnet => &mut self.local_subnet_input_schedule,
            InputQueueType::RemoteSubnet => &mut self.remote_subnet_input_schedule,
        };
        if let Some(sender) = input_schedule.pop_front() {
            // Get the message queue of this canister.
            let input_queue = self.input_queues.get_mut(&sender).unwrap();
            let msg = input_queue.pop().unwrap();
            // If the queue still isn't empty, re-add sender canister ID to the end of the
            // input schedule queue.
            if input_queue.num_messages() != 0 {
                input_schedule.push_back(sender);
            }

            self.input_queues_stats -= InputQueuesStats::stats_delta(&msg);
            self.memory_usage_stats -= MemoryUsageStats::stats_delta(QueueOp::Pop, &msg);
            debug_assert!(self.stats_ok());

            return Some(msg);
        }

        None
    }
/// Pops the next canister-to-canister message from `input_queues`.
///
/// Note: We pop senders from the head of `input_schedule` and insert them
/// to the back, which allows us to handle messages from different
/// originators in a round-robin fashion.
Pops the next canister-to-canister message from `input_queues`.
Note: We pop senders from the head of `input_schedule` and insert them
to the back, which allows us to handle messages from different
originators in a round-robin fashion.
Pops the next canister - to - canister message from ` input_queues ` . Note : We pop senders from the head of ` input_schedule ` and insert them to the back which allows us to handle messages from different originators in a round - robin fashion .
fn pop_canister_input(&mut self, input_queue: InputQueueType) -> Option<RequestOrResponse> {
        let input_schedule = match input_queue {
            InputQueueType::LocalSubnet => &mut self.local_subnet_input_schedule,
            InputQueueType::RemoteSubnet => &mut self.remote_subnet_input_schedule,
        };
        if let Some(sender) = input_schedule.pop_front() {
            // Get the message queue of this canister.
            let input_queue = self.input_queues.get_mut(&sender).unwrap();
            let msg = input_queue.pop().unwrap();
            // If the queue still isn't empty, re-add sender canister ID to the end of the
            // input schedule queue.
            if input_queue.num_messages() != 0 {
                input_schedule.push_back(sender);
            }
            self.input_queues_stats -= InputQueuesStats::stats_delta(&msg);
            self.memory_usage_stats -= MemoryUsageStats::stats_delta(QueueOp::Pop, &msg);
            debug_assert!(self.stats_ok());
            return Some(msg);
        }
        None
    }
fn pop_canister_input ( & mut self , input_queue : InputQueueType ) -> Option < RequestOrResponse > { let input_schedule = match input_queue { InputQueueType :: LocalSubnet => & mut self . local_subnet_input_schedule , InputQueueType :: RemoteSubnet => & mut self . remote_subnet_input_schedule , } ; if let Some ( sender ) = input_schedule . pop_front ( ) { // Get the message queue of this canister. let input_queue = self . input_queues . get_mut ( & sender ) . unwrap ( ) ; let msg = input_queue . pop ( ) . unwrap ( ) ; // If the queue still isn't empty, re-add sender canister ID to the end of the // input schedule queue. if input_queue . num_messages ( ) != 0 { input_schedule . push_back ( sender ) ; } self . input_queues_stats -= InputQueuesStats :: stats_delta ( & msg ) ; self . memory_usage_stats -= MemoryUsageStats :: stats_delta ( QueueOp :: Pop , & msg ) ; debug_assert ! ( self stats_ok ( ) ) ; return Some ( msg ) ; } None }
Pops the next canister-to-canister message from `input_queues`.
Pops the next canister - to - canister message from ` input_queues ` .
&mut self
input_queue
InputQueueType
&mut self
input_queue
InputQueueType