1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! One live generation: a resolved catalog and the retrieval index built over
//! it, bound together so a reader never sees one without the other.
//!
//! The catalog and its retrieval index used to be two independent cells, each
//! swapped on its own. A reload swapped one and then the other, so between the
//! two stores a reader could load a new catalog beside the old index, or the
//! reverse - `need_prompt` offering a name the runner's catalog no longer had,
//! or the runner serving a prompt retrieval could not find. Folding both into
//! one immutable `Generation` behind a single [`ArcSwap`](arc_swap::ArcSwap)
//! makes that torn pair unrepresentable: a reload builds a whole new generation
//! and publishes it in one store, and a reader loads the pair or the older pair,
//! never a mix of the two.
//!
//! A generation is immutable once built. A run or a `need_prompt` call that
//! loaded one finishes under it whatever a concurrent reload publishes, exactly
//! as a run in flight kept its catalog snapshot before.
use Arc;
use crateCatalog;
use crateRetrieval;
use crateShortlist;
/// A resolved catalog and the retrieval index built over exactly that catalog.
///
/// The two are published together and read together, so the index a
/// `need_prompt` call ranks against is always the one built over the catalog a
/// `run_prompt` call in the same generation resolves names in.
pub
/// A generation is loaded by every handler clone and rebuilt from the watcher,
/// so it must cross threads and outlive any one request. A regression that made
/// it otherwise would surface here rather than at a distant `spawn`.
const _: fn = ;