pub async fn fetch_value(
session: &Session,
key: &str,
spec: FetchSpec,
) -> Result<FetchOutcome>Expand description
Fetch one concrete key’s current value on demand — the value half of the lazy-observation contract (issue #84): a selection retrieves one value; nothing is prefetched, nothing stays subscribed.
The ladder, each rung bounded:
- GET the concrete key (storages answer; RFC 04 §3.2’s “a plain GET does not reach publisher caches” is exactly why rung 2 exists);
- GET
<key>/@adv/**?_max=1— zenoh-ext’s AdvancedPublisher cache declares its queryable there and replies with the cached sample on its own concrete key (@advis verbatim, so no data selector ever collides with it — RFC 03 §4 D2 working in our favor); - a brief callback subscription on the key, first sample wins.
Several answers on a rung (multiple storages) resolve by latest HLC timestamp; unstamped answers lose to stamped ones (RFC 04 §1.2’s LWW).