Skip to main content

request_watched

Function request_watched 

Source
pub fn request_watched(
    ctx: &ServiceContext,
    peer: &str,
    msg: &Message,
    secs: i64,
    watch: &dyn Watch,
) -> Result<Message, Error>
Expand description

A bounded request under a command’s Watch: request_within when the watch is not active, and otherwise a request that shows the command’s [q] quit and honours it.

  • Error::Cancelled - the operator quit. If the watch had already stopped, NOTHING was sent; if the quit came during the wait, the request was delivered and it may have happened - a caller reporting a mutation says so.
  • The rest are request_within’s, including its one safe retry: the quittable SDK wait answers a passed deadline and a send that never left with the same Timeout, but it can only report the deadline once the deadline has passed, so a Timeout sooner than secs is a send that never left - nothing happened - and is retried once after reacquiring the peer.
  • Like every noticing wait, it takes the next reply rather than a reply matched to this request, so it is for a caller that tags its requests (gs::fs, gs::net do) and does not serve clients of its own.