pub async fn gathering_complete_promise(&self) -> mpsc::Receiver<()> {
        let (gathering_complete_tx, gathering_complete_rx) = mpsc::channel(1);

        // It's possible to miss the GatherComplete event since setGatherCompleteHandler is an atomic operation and the
        // promise might have been created after the gathering is finished. Therefore, we need to check if the ICE gathering
        // state has changed to complete so that we don't block the caller forever.
        let done = Arc::new(Mutex::new(Some(gathering_complete_tx)));
        let done2 = Arc::clone(&done);
        self.internal
            .set_gather_complete_handler(Box::new(move || {
                log::trace!("setGatherCompleteHandler");
                let done3 = Arc::clone(&done2);
                Box::pin(async move {
                    let mut d = done3.lock().await;
                    d.take();
                })
            }))
            .await;

        if self.ice_gathering_state() == RTCIceGatheringState::Complete {
            log::trace!("ICEGatheringState::Complete");
            let mut d = done.lock().await;
            d.take();
        }

        gathering_complete_rx
    }
/// gathering_complete_promise is a Pion specific helper function that returns a channel that is closed when gathering is complete.
/// This function may be helpful in cases where you are unable to trickle your ICE Candidates.
///
/// It is better to not use this function, and instead trickle candidates. If you use this function you will see longer connection startup times.
/// When the call is connected you will see no impact however.
gathering_complete_promise is a Pion specific helper function that returns a channel that is closed when gathering is complete.
This function may be helpful in cases where you are unable to trickle your ICE Candidates.

It is better to not use this function, and instead trickle candidates. If you use this function you will see longer connection startup times.
When the call is connected you will see no impact however.
gathering_complete_promise is a Pion specific helper function that returns a channel that is closed when gathering is complete . This function may be helpful in cases where you are unable to trickle your ICE Candidates . It is better to not use this function and instead trickle candidates . If you use this function you will see longer connection startup times . When the call is connected you will see no impact however .
pub async fn gathering_complete_promise(&self) -> mpsc::Receiver<()> {
        let (gathering_complete_tx, gathering_complete_rx) = mpsc::channel(1);
        // It's possible to miss the GatherComplete event since setGatherCompleteHandler is an atomic operation and the
        // promise might have been created after the gathering is finished. Therefore, we need to check if the ICE gathering
        // state has changed to complete so that we don't block the caller forever.
        let done = Arc::new(Mutex::new(Some(gathering_complete_tx)));
        let done2 = Arc::clone(&done);
        self.internal
            .set_gather_complete_handler(Box::new(move || {
                log::trace!("setGatherCompleteHandler");
                let done3 = Arc::clone(&done2);
                Box::pin(async move {
                    let mut d = done3.lock().await;
                    d.take();
                })
            }))
            .await;
        if self.ice_gathering_state() == RTCIceGatheringState::Complete {
            log::trace!("ICEGatheringState::Complete");
            let mut d = done.lock().await;
            d.take();
        }
        gathering_complete_rx
    }
pub async fn gathering_complete_promise ( & self ) -> mpsc :: Receiver < ( ) > { let ( gathering_complete_tx , gathering_complete_rx ) = mpsc :: channel ( 1 ) ; // It's possible to miss the GatherComplete event since setGatherCompleteHandler is an atomic operation and the // promise might have been created after the gathering is finished. Therefore, we need to check if the ICE gathering // state has changed to complete so that we don't block the caller forever. let done = Arc :: new ( Mutex :: new ( Some ( gathering_complete_tx ) ) ) ; let done2 = Arc :: clone ( & done ) ; self . internal . set_gather_complete_handler ( Box :: new ( move | | { log :: trace ! ( " " ) ; let done3 = Arc :: clone ( & done2 ) ; Box :: pin ( async move { let mut d = done3 . lock ( ) . await ; d . take ( ) ; } ) } ) ) . await ; if self . ice_gathering_state ( ) == RTCIceGatheringState :: Complete { log :: trace ! ( " " ) ; let mut d = done . lock ( ) . await ; d . take ( ) ; } gathering_complete_rx }
gathering_complete_promise is a Pion specific helper function that returns a channel that is closed when gathering is complete.
gathering_complete_promise is a Pion specific helper function that returns a channel that is closed when gathering is complete .
&self