pub async fn next<T: DeserializeOwned>(
        &mut self,
        timeout: Duration,
    ) -> SubscriptionNextResult<T> {
        match actix_rt::time::timeout(timeout, &mut self.sub.next()).await {
            Err(_) => SubscriptionNextResult::Timeout,
            Ok(Some(msg)) => match deserialize::<T>(&msg.data) {
                Ok(item) => SubscriptionNextResult::Item(item),
                Err(e) => SubscriptionNextResult::Err(e.to_string()),
            },
            Ok(None) => SubscriptionNextResult::Cancelled,
        }
    }
/// Wait for next subscription item and attempt to deserialize
Wait for next subscription item and attempt to deserialize
Wait for next subscription item and attempt to deserialize
pub async fn next<T: DeserializeOwned>(
        &mut self,
        timeout: Duration,
    ) -> SubscriptionNextResult<T> {
        match actix_rt::time::timeout(timeout, &mut self.sub.next()).await {
            Err(_) => SubscriptionNextResult::Timeout,
            Ok(Some(msg)) => match deserialize::<T>(&msg.data) {
                Ok(item) => SubscriptionNextResult::Item(item),
                Err(e) => SubscriptionNextResult::Err(e.to_string()),
            },
            Ok(None) => SubscriptionNextResult::Cancelled,
        }
    }
pub async fn next < T : DeserializeOwned > ( & mut self , timeout : Duration , ) -> SubscriptionNextResult < T > { match actix_rt :: time :: timeout ( timeout , & mut self . sub . next ( ) ) . await { Err ( _ ) => SubscriptionNextResult :: Timeout , Ok ( Some ( msg ) ) => match deserialize :: < T > ( & msg . data ) { Ok ( item ) => SubscriptionNextResult :: Item ( item ) , Err ( e ) => SubscriptionNextResult :: Err ( e . to_string ( ) ) , } , Ok ( None ) => SubscriptionNextResult :: Cancelled , } }
Wait for next subscription item and attempt to deserialize
Wait for next subscription item and attempt to deserialize
&mut self
timeout
Duration
&mut self
timeout
Duration