Skip to content

Latest commit

 

History

History
118 lines (75 loc) · 3.34 KB

File metadata and controls

118 lines (75 loc) · 3.34 KB

Lifecycle Reference

Back to README

Overview

liquidrazor/kernel-state-events provides the concrete immutable implementations for the canonical kernel lifecycle only.

It does not define the event contracts it implements. Those remain owned by liquidrazor/event-manager.

Lifecycle Sequence

The lifecycle represented by this package is:

Booting -> Booted -> Compiling -> Compiled -> ContainerLoading -> ContainerLoaded -> Warming -> Warmed -> Ready -> ShuttingDown -> Shutdown

The separation between compile, container load, and warm is intentional:

  • compile builds immutable structural artifacts
  • container load materializes those artifacts into the runtime container
  • warm prepares parent-safe readonly runtime state

Event Catalog

Every concrete event class is bound to exactly one KernelState enum case.

Event class State enum case State value
KernelBootingEvent KernelState::Booting booting
KernelBootedEvent KernelState::Booted booted
KernelCompilingEvent KernelState::Compiling compiling
KernelCompiledEvent KernelState::Compiled compiled
KernelContainerLoadingEvent KernelState::ContainerLoading container_loading
KernelContainerLoadedEvent KernelState::ContainerLoaded container_loaded
KernelWarmingEvent KernelState::Warming warming
KernelWarmedEvent KernelState::Warmed warmed
KernelReadyEvent KernelState::Ready ready
KernelShuttingDownEvent KernelState::ShuttingDown shutting_down
KernelShutdownEvent KernelState::Shutdown shutdown

Phase Semantics

Booting and Booted

Structural kernel startup and completion of initial bootstrap work.

Compiling and Compiled

Creation and completion of immutable framework compilation artifacts.

ContainerLoading and ContainerLoaded

Materialization of compiled artifacts into the runtime container. This is distinct from compilation itself.

Warming and Warmed

Parent-safe warmup and completion of readonly preparation work.

Ready

The kernel is fully initialized and ready for parent-kernel responsibilities.

ShuttingDown and Shutdown

Orderly kernel teardown and completion of lifecycle closure.

Shared Event Shape

All concrete events in this package are immutable and share the same constructor shape:

new SomeKernelEvent(new KernelIdentity('kernel.main'))

All concrete events expose:

  • kernelIdentity(): KernelIdentity
  • state(): KernelState

The underlying contract implemented by these classes is LiquidRazor\EventManager\Contracts\KernelStateEventInterface, imported from liquidrazor/event-manager.

Supporting Types

KernelIdentity

KernelIdentity is a readonly value object with one public property:

  • identifier

Its constructor trims the incoming string and rejects empty identifiers.

KernelState

KernelState is a backed enum containing one case for each canonical lifecycle meaning:

  • Booting
  • Booted
  • Compiling
  • Compiled
  • ContainerLoading
  • ContainerLoaded
  • Warming
  • Warmed
  • Ready
  • ShuttingDown
  • Shutdown

Boundaries

This package does not include:

  • local event contracts
  • process or runtime event classes
  • request or response events
  • listener registration
  • event dispatching

Back to README