Skip to main content

Module pool

Module pool 

Source
Expand description

A macula 12 node’s set of station links, as macula’s client pool keeps them: one link to each seed station, every seed pinned by its node_id, all links of one node sharing its identity key, statement issuer, request admission, publication seq and event dedup. A link that ends is dialed again after the respawn delay and given back the node’s subscriptions and served procedures.

Calls reach providers directly, as macula 12 calls them: the procedure’s advertisements are resolved from the DHT and checked against the realm key the pool pins for the realm, the serving station an advertisement names is dialed (pinned by its node_id, from its own station_endpoint record) and the provider called there. Station procedures (_dht.*) go to the pool’s links.

Station discovery beyond the seeds is not here: macula’s discovery calls hecate_stations.list_stations, which the fleet no longer serves (macula-io/macula#31).

Structs§

Call
A call to a procedure: its realm and name, the provider to call (any trusted one when zero), the payload, how long to wait (DEFAULT_CALL_TIMEOUT when zero), and a UCAN and its proofs for a gated procedure.
ContentOptions
A fetch’s bounds, macula_content_fetch’s defaults: 256 MiB, 16,384 chunks, 4 chunk streams at a time, 15 seconds per stream.
LinkEvent
A link coming up, or ending or failing to dial with its error.
LinkStatus
One of the pool’s links.
Offer
A procedure the node serves: its realm, which the pool must pin a key for unless the procedure is in the node’s own namespace, its name, and exactly one of a unary handler and a stream offer.
Opts
A pool’s configuration. Opts::new gives macula’s defaults; a zero bound also means its default.
Pool
A node’s station links. Cloning it shares the pool; the pool closes when Pool::close is called or its last handle is dropped.
Provider
A node serving a procedure, and the station it serves from.
Seed
A station to link to: where it is dialed and the node_id it must prove.
Served
A procedure the node serves on every link the pool holds, and on every link it dials later, until Served::stop.
StreamCall
A streaming session to open: its realm and name, the provider (any trusted one when zero), the mode, the open’s payload, its deadline (the link’s default when zero), and a UCAN and its proofs for a gated procedure. Its default mode is server_stream.
Subscription
The node’s subscription to a realm and topic, on every link the pool holds and every link it dials later, until Subscription::unsubscribe or the pool closes.

Enums§

LinkSelection
The order calls, publications and DHT operations try the pool’s links in.
PoolError
Why a pool, or one of its operations, failed.

Constants§

CONTENT_PROCEDURE
The content procedure’s name in a sharer’s own namespace.
DEFAULT_CONNECT_TIMEOUT
DEFAULT_MAX_DIRECT_LINKS
DEFAULT_MAX_SEEDS
DEFAULT_REPLICATION_FACTOR
macula’s defaults and caps for a pool’s bounds.
DEFAULT_RESPAWN_DELAY

Functions§

content_procedure_bound
Whether procedure is node’s content procedure: ~<node>/content_v1, or <org>/content_v1_<node> under an org that is not empty, _, nor a ~ namespace, each node as 64 lowercase hex, so an announcement cannot point a fetch at another node’s procedure.