Skip to main content

Module local_infra

Module local_infra 

Source
Expand description

Discovery of local infrastructure the node can reuse instead of starting its own copy: a mail4agent courier, another gate4agent node.

Rule: an existing process is never killed or relaunched just because it exists. The node probes the loopback address it would bind, reads the service’s GET /health (service name, version, optional capabilities) and then owns, attaches to, or steps around it. Upgrading an older instance is a graceful handoff through that service’s control endpoint (see the local-infra-reuse spec); this module only reports the need.

Modules§

control
Control verbs a reusable service advertises in capabilities.

Structs§

ServiceInfo
What a reused service reported about itself.

Enums§

Probe
What answers on a loopback address.
Upgrade
Upgrade decision for a reused service.

Functions§

auto_upgrade_allowed
HATCHERY_LOCAL_UPGRADE=off disables automatic handoff (default: auto).
handoff
Ask the service on addr to hand over, then wait until the port is free. The service exits by itself; nothing is killed.
parse_version
MAJOR.MINOR.PATCH (pre-release / build suffix ignored).
probe
Probe addr for service (the service field its /health returns).
upgrade_plan
force = take over even when not older (redeploy of the same version).
wait_port_free
Poll until addr can be bound (the old owner released it).