Expand description
Consumer-side discovery wiring for eventual readiness.
Bridges the service DirectoryClient into the
contract layer’s EndpointResolver, and carries the
ConsumerRegistrations emitted by #[toolkit::consumes] that the
runtime’s proxy-wiring phase replays at startup.
Unconditional: consuming another gear over a discovered REST transport is
the normal case, and #[toolkit::consumes] emits its registration
unconditionally too. Putting this behind a feature only created a way to
build a gear whose declared dependencies were silently never wired.
Structs§
- Consumer
Registration - A consumer→provider contract wiring, registered by
#[toolkit::consumes]viainventory::submit!and replayed by the runtime’s proxy-wiring phase. - Directory
Endpoint Resolver - Adapts the service
DirectoryClientinto the contract-layerEndpointResolverconsumed byDirectoryResolvingClient. - Null
Endpoint Resolver - An
EndpointResolverthat never resolves any gear (Ok(None)for every lookup). Used by the proxy-wiring phase when noDirectoryClientis present in theClientHub: co-located (local) consumers still short-circuit and wire successfully, while remote consumers register as unresolved readiness gates (so/readyzcorrectly stays 503) rather than being silently skipped. - Resolve
Error - Re-export so the
#[toolkit::consumes]-generated wire fn can name the resolver type astoolkit::discovery::EndpointResolverwithout the consuming gear crate needing a directtoolkit-contractdependency. Directory-lookup failure (the directory backend itself could not answer — e.g. the gRPC directory is unreachable), as opposed to a successful lookup that found no live instance (Ok(None)). Keeping the two distinct lets callers and observability tell a not-ready provider apart from a directory outage. - Static
Endpoint Resolver - An
EndpointResolverthat always resolves to a single, fixed endpoint — the ADR-0004 static-endpoint override escape hatch for local development and integration testing. It bypasses the service directory: a consumer configured withgears.<owner>.config.consumer_wiring.<dep> = "http://host:port"wires a resolving client whose endpoint is this constant. Not for production use.
Enums§
- Wire
Outcome - Outcome of a
ConsumerRegistration::wirecall: whether the dependency was satisfied by a co-located compile-time impl (no directory dependency) or by a directory-resolving REST client that still needs endpoint resolution.
Traits§
- Endpoint
Resolver - Re-export so the
#[toolkit::consumes]-generated wire fn can name the resolver type astoolkit::discovery::EndpointResolverwithout the consuming gear crate needing a directtoolkit-contractdependency. Resolves a logical gear name to a live base endpoint URI.
Type Aliases§
- WireFn
- The wiring function pointer emitted by
#[toolkit::consumes]. Registers the client into theClientHub, given the endpoint resolver and the process’s platform-plane credential source (threaded onto a directory-resolving remote client). Aliased to keep the fn-pointer type readable.