/// Consume and handle a command received from the local device.
/// This method:
///   1) Attempts to drive the procedure with the `command`. SLCI updates are handled immediately.
///      Any non-SLCI updates received before the SLC has been initialized will be queued and
///      processed FIFO after initialization.
///   2) Handles any subsequent request from (1) - sending any bytes to the peer
///      if needed or queueing up information requests to be consumed by the internal receiver.
Consume and handle a command received from the local device.
This method:
1) Attempts to drive the procedure with the `command`. SLCI updates are handled immediately.
Any non-SLCI updates received before the SLC has been initialized will be queued and
processed FIFO after initialization.
2) Handles any subsequent request from (1) - sending any bytes to the peer
if needed or queueing up information requests to be consumed by the internal receiver.
Consume and handle a command received from the local device . This method : 1 ) Attempts to drive the procedure with the ` command ` . SLCI updates are handled immediately . Any non - SLCI updates received before the SLC has been initialized will be queued and processed FIFO after initialization . 2 ) Handles any subsequent request from ( 1 ) - sending any bytes to the peer if needed or queueing up information requests to be consumed by the internal receiver .
pub async fn receive_ag_request(&mut self, id: ProcedureMarker, command: AgUpdate) {
        // Non-SLCI requests received before initialization will be queued for later.
        // If there are still outstanding requests pending initialization, queue the request to
        // be processed after to maintain ordering of events.
        if id != ProcedureMarker::SlcInitialization {
            if !self.initialized() || !self.requests_pending_initialization.is_empty() {
                self.requests_pending_initialization.push_back((id, command));
                return;
            }
        }
        let request = self.handle_command(id, command.into());
        // If the command requires more information, relay the request to the stream implementation.
        // Otherwise, the command was handled and we should attempt to send any queued packets.
        let info_request = match self.procedure_request(request) {
            Some(r) => r,
            None => {
                // TODO(fxbug.dev/73027): Propagate this error to PeerTask to be handled.
                if let Err(e) = self.send_queued().await {
                    warn!("Error sending queued messages: {:?}", e);
                }
                return;
            }
        };
        if let Err(e) = self.sender.try_send(info_request) {
            warn!("Couldn't relay procedure info request to internal receiver: {:?}", e);
        }
    }
pub async fn receive_ag_request ( & mut self , id : ProcedureMarker , command : AgUpdate ) { // Non-SLCI requests received before initialization will be queued for later. // If there are still outstanding requests pending initialization, queue the request to // be processed after to maintain ordering of events. if id != ProcedureMarker :: SlcInitialization { if ! self . initialized ( ) || ! self . requests_pending_initialization . is_empty ( ) { self . requests_pending_initialization . push_back ( ( id , command ) ) ; return ; } } let request = self . handle_command ( id , command . into ( ) ) ; // If the command requires more information, relay the request to the stream implementation. // Otherwise, the command was handled and we should attempt to send any queued packets. let info_request = match self . procedure_request ( request ) { Some ( r ) => r , None => { // TODO(fxbug.dev/73027): Propagate this error to PeerTask to be handled. if let Err ( e ) = self . send_queued ( ) . await { warn ! ( " " e ) ; } return ; } } ; if let Err ( e ) = self . sender . try_send ( info_request ) { warn ! ( " " e ) ; } }
Consume and handle a command received from the local device.
Consume and handle a command received from the local device .
&mut self
id
ProcedureMarker
command
AgUpdate