/// 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) -> Option<RequestOrResponse> {
        if let Some(sender) = self.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 {
                self.input_schedule.push_back(sender);
            }
            self.input_queues_message_count -= 1;
            self.input_queues_size_bytes -= InputQueue::message_size_bytes(&msg);
            debug_assert_eq!(
                Self::input_queues_stats(&self.input_queues),
                (
                    self.input_queues_message_count,
                    self.input_queues_size_bytes
                )
            );
            return Some(msg);
        }
        None
    }
fn pop_canister_input ( & mut self ) -> Option < RequestOrResponse > { if let Some ( sender ) = self . 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 { self . input_schedule . push_back ( sender ) ; } self . input_queues_message_count -= 1 ; self . input_queues_size_bytes -= InputQueue :: message_size_bytes ( & msg ) ; debug_assert_eq ! ( Self input_queues_stats ( self input_queues ) ( self input_queues_message_count self input_queues_size_bytes ) ) ; 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