/// Processes incoming commands from the browse stream and dispatches them to a
/// browse channel handler.
Processes incoming commands from the browse stream and dispatches them to a
browse channel handler.
Processes incoming commands from the browse stream and dispatches them to a browse channel handler .
async fn process_browse_stream(peer: Arc<RwLock<RemotePeer>>) {
    let connection = {
        let peer_guard = peer.read();
        match peer_guard.browse_channel.connection() {
            Some(connection) => connection.clone(),
            None => return,
        }
    };
    let browse_command_stream = connection.take_command_stream();
    // Limit to 16 since that is the max number of transactions we can process at any one time per
    // AVCTP.
    match browse_command_stream
        .map(Ok)
        .try_for_each_concurrent(16, |command| async {
            let fut = peer.read().browse_command_handler.handle_command(command.unwrap());
            let result: Result<(), PeerError> = fut.await;
            result
        })
        .await
    {
        Ok(_) => fx_log_info!("Peer command stream closed"),
        Err(e) => fx_log_err!("Peer command returned error {:?}", e),
    }
    // Browse channel closed or errored. Do nothing because the control channel can still exist.
}
async fn process_browse_stream ( peer : Arc < RwLock < RemotePeer > > ) { let connection = { let peer_guard = peer . read ( ) ; match peer_guard . browse_channel . connection ( ) { Some ( connection ) => connection . clone ( ) , None => return , } } ; let browse_command_stream = connection . take_command_stream ( ) ; // Limit to 16 since that is the max number of transactions we can process at any one time per // AVCTP. match browse_command_stream . map ( Ok ) . try_for_each_concurrent ( 16 , | command | async { let fut = peer . read ( ) . browse_command_handler . handle_command ( command . unwrap ( ) ) ; let result : Result < ( ) , PeerError > = fut . await ; result } ) . await { Ok ( _ ) => fx_log_info ! ( " " ) , Err ( e ) => fx_log_err ! ( " " e ) , } // Browse channel closed or errored. Do nothing because the control channel can still exist. }
Processes incoming commands from the browse stream and dispatches them to a
browse channel handler.
Processes incoming commands from the browse stream and dispatches them to a browse channel handler .
peer
Arc<RwLock<RemotePeer>>