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
//! Services, actions and streams (blueprint §9.4).
//!
//! > All three ride ordinary edges plus metadata correlation — no separate RPC
//! > subsystem: services (`request_id`), actions (`goal_id`/`goal_status` FSM:
//! > Accepted→Executing→{Succeeded, Aborted, Canceled}), streams
//! > (`session_id`/`segment_id`/`seq`/`fin`/`flush`).
//!
//! That sentence is the whole design. There is no service socket, no action
//! server, no stream channel — there are edges, and there is
//! [`astrs_wire::Metadata`]. What this module adds is the bookkeeping that
//! makes the three patterns *correct* rather than merely expressible:
//!
//! | Pattern | What is easy to get wrong | What this module does |
//! |---|---|---|
//! | [`service`] | Answering with the wrong (or no) `request_id` | [`ServiceRequest`] carries the id; the response helper copies it |
//! | [`action`] | An illegal FSM transition, or a status after a terminal one | [`GoalTracker`] refuses both |
//! | [`stream`] | Gaps, reordering, a segment that never ends | [`StreamAssembler`] detects all three |
//!
//! # Eviction immunity comes for free
//!
//! A message carrying `request_id`, `goal_id` or `goal_status` is
//! eviction-immune in every input queue (§11.2), because
//! [`astrs_wire::Metadata::is_correlated`] says so and
//! [`crate::events::QueuedEvent`] forwards that to the scheduler. So a service
//! response cannot be the message a full queue drops — which is the one drop
//! that would wedge a client forever.
pub use ;
pub use ;
pub use ;
/// A fresh, unique correlation id.
///
/// UUIDv7, so ids sort by creation time — which makes a log of correlated
/// messages readable in the order they happened without a separate timestamp
/// column.