Docs/API Reference/Kernel

Kernel API: application lifecycle

The instance method shuts down the providers belonging to the active application stored in the global runtime. Prefer the instance method when you composed a custom application.

1 min read

Application#

  • static configure(): ApplicationBuilder
  • bootstrap(): Promise<void>
  • shutdown(): Promise<void>
  • static shutdown(): Promise<void>

The instance method shuts down the providers belonging to the active application stored in the global runtime. Prefer the instance method when you composed a custom application.

ApplicationBuilder#

  • use(provider: ProviderEntry): this
  • with(provider: ProviderEntry): this
  • withProviders(providers: ProviderEntry[]): this
  • create(): Application

ProviderEntry can be a ServiceProvider instance, a subclass constructor, or a callback receiving the container and returning a provider. withPlugins, withMail, withCommunication, withSettings and withMigrations are added by their respective package composition modules; they are not all base-kernel methods.

Lifecycle order#

  1. Base KernelServiceProvider is added.
  2. All provider register() methods run in registration order.
  3. All provider boot() methods run in registration order.
  4. system:ready is published after successful initialization.
  5. On shutdown, provider shutdown() hooks run in reverse order, then system:stop is attempted.

Bootstrap is deduplicated globally and skips browser execution, the Next.js production build phase and SKIP_VEAP_INIT=true. Keep the composition root server-only and make any initialization side effects safe for the deployment lifecycle.

veap
Preparing0%