pub async fn create_missing_transports(
        users: &Vec<Rc<RwLock<User>>>,
        router: Router,
        is_consumer: bool,
    ) {
        let router_id = router.id();
        for user_rw_lock in users {
            let mut transport_exist = false;
            {
                let user = user_rw_lock.as_ref().read().await;
                for transport in user.get_transports(true) {
                    let transport_router_id = transport
                        .app_data()
                        .deref()
                        .clone()
                        .downcast::<TransportAppData>()
                        .unwrap()
                        .as_ref()
                        .router_id;
                    if transport_router_id == router_id {
                        transport_exist = true
                    }
                }
            }
            if !transport_exist {
                println!("creating_webrtc_trasnrpot for missed people");
                Room::create_webrtc_transport(user_rw_lock.clone(), router.clone(), is_consumer)
                    .await
            }
        }
    }
///
/// This function creates missing webrtc transports when application scales up.
///
This function creates missing webrtc transports when application scales up.
This function creates missing webrtc transports when application scales up .
pub async fn create_missing_transports(
        users: &Vec<Rc<RwLock<User>>>,
        router: Router,
        is_consumer: bool,
    ) {
        let router_id = router.id();
        for user_rw_lock in users {
            let mut transport_exist = false;
            {
                let user = user_rw_lock.as_ref().read().await;
                for transport in user.get_transports(true) {
                    let transport_router_id = transport
                        .app_data()
                        .deref()
                        .clone()
                        .downcast::<TransportAppData>()
                        .unwrap()
                        .as_ref()
                        .router_id;
                    if transport_router_id == router_id {
                        transport_exist = true
                    }
                }
            }
            if !transport_exist {
                println!("creating_webrtc_trasnrpot for missed people");
                Room::create_webrtc_transport(user_rw_lock.clone(), router.clone(), is_consumer)
                    .await
            }
        }
    }
pub async fn create_missing_transports ( users : & Vec < Rc < RwLock < User > > > , router : Router , is_consumer : bool , ) { let router_id = router . id ( ) ; for user_rw_lock in users { let mut transport_exist = false ; { let user = user_rw_lock . as_ref ( ) . read ( ) . await ; for transport in user . get_transports ( true ) { let transport_router_id = transport . app_data ( ) . deref ( ) . clone ( ) . downcast :: < TransportAppData > ( ) . unwrap ( ) . as_ref ( ) . router_id ; if transport_router_id == router_id { transport_exist = true } } } if ! transport_exist { println ! ( " " ) ; Room :: create_webrtc_transport ( user_rw_lock . clone ( ) , router . clone ( ) , is_consumer ) . await } } }
This function creates missing webrtc transports when application scales up.
This function creates missing webrtc transports when application scales up .
users
&Vec<Rc<RwLock<User>>>
router
Router
is_consumer
bool
users
&Vec<Rc<RwLock<User>>>
router
Router
is_consumer
bool