/// Blocks until the result of the ingress message with the specified ID is
/// available.
///
/// # Panics
///
/// This function panics if the result doesn't become available in a
/// reasonable amount of time (typically, a few seconds).
Blocks until the result of the ingress message with the specified ID is
available.
Blocks until the result of the ingress message with the specified ID is available .
pub fn await_ingress(&self, msg_id: MessageId) -> Result<WasmResult, UserError> {
        let mut tries = 0;
        while tries < 100 {
            match self.ingress_status(&msg_id) {
                IngressStatus::Completed { result, .. } => return Ok(result),
                IngressStatus::Failed { error, .. } => return Err(error),
                _ => {
                    tries += 1;
                    std::thread::sleep(Duration::from_millis(100));
                    continue;
                }
            }
        }
        panic!("didn't get answer to ingress {}", msg_id)
    }
pub fn await_ingress ( & self , msg_id : MessageId ) -> Result < WasmResult , UserError > { let mut tries = 0 ; while tries < 100 { match self . ingress_status ( & msg_id ) { IngressStatus :: Completed { result , .. } => return Ok ( result ) , IngressStatus :: Failed { error , .. } => return Err ( error ) , _ => { tries += 1 ; std :: thread :: sleep ( Duration :: from_millis ( 100 ) ) ; continue ; } } } panic ! ( " " msg_id ) }
Blocks until the result of the ingress message with the specified ID is
available.
Blocks until the result of the ingress message with the specified ID is available .
&self
msg_id
MessageId
panics
This function panics if the result doesn't become available in a
reasonable amount of time (typically, a few seconds).
This function panics if the result doesn ' t become available in a reasonable amount of time ( typically a few seconds ) .