Documentation
¶
Overview ¶
Package lifecycle defines canonical descriptors for generated application lifecycle callbacks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnStart ¶
func OnStart() sdk.Definition
OnStart marks a provider-owned method that runs after dependency construction and before the application becomes ready.
The exact method signature is func(context.Context) error. Callbacks start dependency-first. A failure rolls back already-started callbacks and constructed providers in reverse deterministic order.
// @import { OnStart } from "github.com/spice-framework/spice/annotation/lifecycle"
// @OnStart
func (*Server) Start(context.Context) error
func OnStartHandler ¶
OnStartHandler contributes a dependency-ordered start callback.
func OnStop ¶
func OnStop() sdk.Definition
OnStop marks a provider-owned method that runs during graceful shutdown.
The exact method signature is func(context.Context) error. Callbacks run in reverse dependency order before construction cleanups. Stop is idempotent and uses the caller-owned shutdown context.
// @import { OnStop } from "github.com/spice-framework/spice/annotation/lifecycle"
// @OnStop
func (*Server) Stop(context.Context) error
func OnStopHandler ¶
OnStopHandler contributes a reverse-dependency stop callback.
Types ¶
This section is empty.