///
/// Gets the value of the given Node (optionally waiting for it to have changed since the given
/// LastObserved token), and then returns its new value and a new LastObserved token.
///
Gets the value of the given Node (optionally waiting for it to have changed since the given
LastObserved token), and then returns its new value and a new LastObserved token.
Gets the value of the given Node ( optionally waiting for it to have changed since the given LastObserved token ) and then returns its new value and a new LastObserved token .
pub async fn poll(
    &self,
    node: N,
    token: Option<LastObserved>,
    delay: Option<Duration>,
    context: &N::Context,
  ) -> Result<(N::Item, LastObserved), N::Error> {
    // If the node is currently clean at the given token, Entry::poll will delay until it has
    // changed in some way.
    if let Some(LastObserved(generation)) = token {
      let entry = {
        let mut inner = self.inner.lock();
        let entry_id = inner.ensure_entry(node.clone());
        inner.unsafe_entry_for_id(entry_id).clone()
      };
      entry.poll(context, generation).await;
      if let Some(delay) = delay {
        delay_for(delay).await;
      }
    };
    // Re-request the Node.
    let (res, generation) = self
      .get_inner(context, node, EdgeType::Strong)
      .await?
      .expect("A strong dependency cannot return None.");
    Ok((res, LastObserved(generation)))
  }
pub async fn poll ( & self , node : N , token : Option < LastObserved > , delay : Option < Duration > , context : & N :: Context , ) -> Result < ( N :: Item , LastObserved ) , N :: Error > { // If the node is currently clean at the given token, Entry::poll will delay until it has // changed in some way. if let Some ( LastObserved ( generation ) ) = token { let entry = { let mut inner = self . inner . lock ( ) ; let entry_id = inner . ensure_entry ( node . clone ( ) ) ; inner . unsafe_entry_for_id ( entry_id ) . clone ( ) } ; entry . poll ( context , generation ) . await ; if let Some ( delay ) = delay { delay_for ( delay ) . await ; } } ; // Re-request the Node. let ( res , generation ) = self . get_inner ( context , node , EdgeType :: Strong ) . await ? . expect ( " " ) ; Ok ( ( res , LastObserved ( generation ) ) ) }
Gets the value of the given Node (optionally waiting for it to have changed since the given
LastObserved token), and then returns its new value and a new LastObserved token.
Gets the value of the given Node ( optionally waiting for it to have changed since the given LastObserved token ) and then returns its new value and a new LastObserved token .
&self
node
N
token
Option<LastObserved>
delay
Option<Duration>
context
&N::Context