OptionallifecycleLifecycle registrar provided by the boot planner. Builders that produce a resource requiring cleanup (database client, interval timer, etc.) SHOULD call:
ctx.lifecycle?.register(async () => { await resource.close(); })
Optional: factories constructed outside the boot planner (e.g. unit
tests) receive {} as ctx, so ctx.lifecycle is undefined. Always
use optional chaining.
OptionalloggerStructured logger provided by the boot planner from the optional
logger ComponentMap slot. Builders that attach an error listener to
a connection they open report through it:
client.on("error", (err) => ctx.logger?.error({ err }, "…_error"))
Same channel as lifecycle and readiness on purpose: a builder that
opens a connection owns its cleanup, its probe, and its error listener,
and having those three arrive by three different routes is how one of
them gets forgotten. Falls back to consoleLogger when absent.
OptionalreadinessReadiness registrar provided by the boot planner. Builders that open a connection SHOULD register a probe for it:
ctx.readiness?.register({ name: "redis", check: () => client.ping() })
Registration belongs here for the same reason cleanup does: the builder
is the only place holding the connection. The adapter it returns exposes
a narrow command surface with no ping, so a composition root cannot
build the probe from the outside.
Optional, and subject to the same optional-chaining rule as BuilderContext.lifecycle.
Builder context passed to every adapter builder. All fields are optional and additions remain additive-only (non-breaking). Builders may ignore fields they do not need.
Planned future fields: