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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//! **The off-frame threads** — the asker, the poster, the queue lane and the
//! two held lanes.
//!
//! A frame that never blocks means no read and no act happens on one. These are
//! where they happen: five loops on five sockets, each talking to the window
//! only through [`Link`](crate::state::Link) — frames that landed one way,
//! gestures to send the other, and the standing question set published by the
//! frame that last settled.
//!
//! # Five, because they wait for different things
//!
//! The **asker** goes round the standing set at human cadence: every channel's
//! roster, the aimed wall's conversations, the selected conversation's
//! transcript. The **poster** sends what a click composed and files the receipt
//! it earns, on its own thread because an act must not wait behind a read that
//! is mid-pass. The **follow lane** holds one connection open on the focused
//! conversation and is answered as the tail moves, which is a read that
//! deliberately never finishes and must therefore never be in the serial pass.
//! The **queue lane** asks `attention`, which an engine can take half a
//! minute to answer, so nothing else waits behind it (bl-5439).
//!
//! # Every pass is a function a test calls directly
//!
//! Each worker's body is `tick`, and a thread is [`pump`] around one. So the
//! suite drives a real pass against the stand-in engine with no thread at all,
//! and the one end-to-end beat is about the threading rather than about what
//! the passes do.
//!
//! **A stop is seen between passes, not during one.** The follow lane is the
//! case that matters: it is parked on a socket read, so it learns of a stop
//! when the engine writes, when the connection closes, or when the transport's
//! own read timeout expires. That is not a leak — closing the window ends the
//! process — and the alternative is a second signal path into a blocking read,
//! which is a mechanism for a case that has no consequence.
use ;
use JoinHandle;
use Value;
use crateReach;
use crate;
use crateChannel;
/// One pass of the standing reads.
/// One pass of the follow lane.
/// One pass of the outbox.
/// One pass of the queue lane.
/// One pass of the sign-in lane.
/// **A gesture addressed at a CHANNEL**, not at a workspace: it names none, so
/// there is nothing for the §8.2 mapping to resolve and the channel has to be
/// opened by the name this box knows it by.
///
/// It lives here rather than in one worker because **both** spend it: the
/// asker fans the standing roster and queue reads over every channel, and the
/// poster fans a gesture a frame composed that names no workspace (bl-40ec).
/// Two spellings of *ask this channel and file what it said* would be two
/// places a stamp could drift.
///
/// **The failure arm is the caller's and no longer this function's** (REMOTE
/// §3, bl-3969). What a leg that reached nothing MEANS is not a property of the
/// leg: a read is asked again on the next beat, and an act may not be. So this
/// hands the [`Reach`] back and the two callers each say the one thing they are
/// entitled to say. The stamp, the dial and the filing stay here, which is what
/// the shared spelling was ever for.
pub
/// Every frame of one answer, in order. **An answer of no frames is reported as
/// nothing**, which is what it is: the engine terminated the stream without
/// saying anything, and a seat that invented a sentence for it would be
/// speaking for an engine that did not.
///
/// **Every frame carries the op it answers** (bl-693d), a read's as an act's:
/// a refusal wears no `kind`, and the roster read's refusal is the one that
/// belongs on its channel's section rather than in the bar.
pub
/// **Start the four threads.** The handles come back so a caller that stopped
/// the link can wait for the passes in flight to finish; a caller that does not
/// want to wait can drop them.
/// One worker's loop: pass, wait a beat, pass again, until the link says stop.
///
/// The wait is the **cadence** and not a timeout. A seat asks at the rate an
/// operator looks, and the two surfaces that move faster than that are held
/// reads rather than a faster loop.