/// Helper function to poll the call_updates collection for call state changes.
/// Polls until there are no more updates ready. Updates internal state with
/// available items.
Helper function to poll the call_updates collection for call state changes.
Polls until there are no more updates ready. Updates internal state with
available items.
Helper function to poll the call_updates collection for call state changes . Polls until there are no more updates ready . Updates internal state with available items .
fn poll_and_consume_call_updates(&mut self, cx: &mut Context<'_>) {
        // Loop until self.call_updates is terminated or the stream is exhausted.
        while !self.call_updates.is_terminated() {
            match self.call_updates.poll_next_unpin(cx) {
                Poll::Ready(Some(item)) => match item {
                    StreamItem::Item((index, Ok(state))) => {
                        if let Some(call) = self.current_calls.get_mut(index) {
                            call.set_state(state);
                        } else {
                            self.remove_call(index);
                        }
                    }
                    StreamItem::Item((index, Err(e))) => {
                        info!("Call {} channel closed with error: {}", index, e);
                        self.remove_call(index);
                    }
                    StreamItem::Epitaph(index) => {
                        debug!("Call {} channel closed", index);
                        self.remove_call(index);
                    }
                },
                Poll::Ready(None) | Poll::Pending => break,
            }
        }
    }
fn poll_and_consume_call_updates ( & mut self , cx : & mut Context < ' _ > ) { // Loop until self.call_updates is terminated or the stream is exhausted. while ! self . call_updates . is_terminated ( ) { match self . call_updates . poll_next_unpin ( cx ) { Poll :: Ready ( Some ( item ) ) => match item { StreamItem :: Item ( ( index , Ok ( state ) ) ) => { if let Some ( call ) = self . current_calls . get_mut ( index ) { call . set_state ( state ) ; } else { self . remove_call ( index ) ; } } StreamItem :: Item ( ( index , Err ( e ) ) ) => { info ! ( " " index e ) ; self . remove_call ( index ) ; } StreamItem :: Epitaph ( index ) => { debug ! ( " " index ) ; self . remove_call ( index ) ; } } , Poll :: Ready ( None ) | Poll :: Pending => break , } } }
Helper function to poll the call_updates collection for call state changes.
Helper function to poll the call_updates collection for call state changes .
&mut self
cx
&mut Context<'_>