Skip to main content

somatize_fabric_broker/
lib.rs

1//! The rendezvous: turning the name a graph gave a host into a way of reaching
2//! it.
3//!
4//! A client always does the same thing — it talks to a broker — and the only
5//! thing that changes between having a platform account, having a head node,
6//! and having neither is **which** broker, which is a URL. There is no second
7//! code path and no degraded mode.
8//!
9//! | deployment | what it is | what it adds |
10//! |---|---|---|
11//! | embedded | in the client's own process | nothing. It is what makes soma work alone |
12//! | local | a process on a head node | reachable by more than one client |
13//! | platform | ours | authentication, pairing, leases, metering |
14//!
15//! Here today: `protocol` and [`Path`] — three questions, four answers, and the
16//! four ways a pair of endpoints can end up talking — and [`Embedded`], the
17//! first of the three deployments. The other two arrive with their consumers,
18//! and so does a `Broker` trait: today it would have one implementor.
19//!
20//! The one decision worth knowing before reading the code: **control and cargo
21//! go by different routes.** What crosses here is a rendezvous — tens of bytes,
22//! once per host per session — while what crosses the wire next door is an
23//! activation. The broker is in the first and steps out of the second, which is
24//! why an embedded broker can be a thread with real serialized messages and
25//! still cost nothing anyone can measure.
26
27#![forbid(unsafe_code)]
28#![warn(missing_docs)]
29
30mod embedded;
31mod path;
32mod protocol;
33mod reaching;
34mod session;
35
36pub use embedded::{Embedded, Unanswered};
37pub use path::{Endpoint, Path, SessionId, SlotId};
38pub use protocol::{Ask, Identity, Needs, PROTOCOL, Reply, Unreadable};
39pub use reaching::Reaching;
40pub use session::Session;
41
42// Re-exported because it is this conversation's subject: a `Reach` names one,
43// and whoever answers has to hold the same type the engine placed.
44pub use somatize_core::Host;