Expand description
Asynchronous query resources and clocks for scenarios.
A Query is the display state of one query subscription: first load,
data, refresh and failure, so controls do not stitch booleans together.
Every request gets a new parameter version; only the result for the
current version is accepted. A slower answer to an older request — the
first of two searches typed in a row — is discarded instead of
overwriting the newer result, and the older request is cancelled. This
“current result only” rule is for queries; engine commands keep their own
retry and idempotency policies.
QuerySubscriptions holds the live subscriptions of a UI session.
Each belongs to a window instance and ends with it; a subscription whose
query reads engine state is requested again when that state changes.
Providers schedule delayed work through a Clock. SystemClock
uses real time; ManualClock only moves when a scenario advances it,
so the order of asynchronous completions is part of the test, not an
accident.
Structs§
- Cancellation
- Signals a query provider that its answer is no longer wanted: the subscription moved on to newer parameters or ended. Clones share the same flag, so the requester and the provider see one request.
- Manual
Clock - A clock that only moves when a scenario advances it. Timers fire in due order, ties in the order they were scheduled, on the thread that advances the clock.
- Query
- One query subscription with its parameter versions.
- Query
Subscription - A live subscription to one catalog query, owned by a window instance.
- Query
Subscriptions - The query subscriptions of one UI session.
- System
Clock - Real time. One timer thread runs while timers are pending and ends when none are left.
- Ticket
- Identity of one request: the parameter version it was made for.
Enums§
- Resolution
- Whether a result changed what the query shows.
- Resource
- What a query shows. An empty result is
Readywith empty data: success, not failure.
Traits§
- Clock
- Time source for providers that answer later. Scenarios inject a
ManualClockto decide the order of completions.