Class: Kernel<IncomingEventType, OutgoingResponseType>
Class: Kernel<IncomingEventType, OutgoingResponseType>
Class representing a Kernel.
The Kernel class is responsible for managing the main lifecycle of the application, including middleware registration and provider management. It manages the initialization, registration, and booting of the components required for a fully functional application.
Author
Mr. Stone evensstone@gmail.com
Type Parameters
IncomingEventType
IncomingEventType
extends IncomingEvent
OutgoingResponseType
OutgoingResponseType
extends OutgoingResponse
Implements
ILifecycleAdapterEventHandler
<IncomingEventType
,OutgoingResponseType
>
Methods
handle()
handle(event): Promise<OutgoingResponseType>;
Handle Stone IncomingEvent.
Parameters
event
IncomingEventType
The Stone incoming event to handle.
Returns
Promise
<OutgoingResponseType
>
The Stone outgoing response.
Implementation of
ILifecycleAdapterEventHandler.handle
onEventHandled()
onEventHandled(): Promise<void>;
Invoke subsequent hooks after handling the event.
Returns
Promise
<void
>
Implementation of
ILifecycleAdapterEventHandler
.onEventHandled
onHandlingEvent()
onHandlingEvent(): Promise<void>;
Boot the providers. Invoke subsequent hooks. Note: Execution order is important here, never change it.
Returns
Promise
<void
>
Implementation of
ILifecycleAdapterEventHandler
.onHandlingEvent
onInit()
onInit(): Promise<void>;
Populate the context with the given bindings. The context here is the service container. Invoke subsequent hooks. Note: Execution order is important here, never change it.
Returns
Promise
<void
>
Implementation of
ILifecycleAdapterEventHandler
.onInit
onTerminate()
onTerminate(): Promise<void>;
Invoke subsequent hooks on termination.
Returns
Promise
<void
>
Implementation of
ILifecycleAdapterEventHandler
.onTerminate
create()
static create<IncomingEventType, OutgoingResponseType>(options): Kernel<IncomingEventType, OutgoingResponseType>;
Create a Kernel.
Type Parameters
IncomingEventType
IncomingEventType
extends IncomingEvent
OutgoingResponseType
OutgoingResponseType
extends OutgoingResponse
Parameters
options
Kernel configuration options.
Returns
Kernel
<IncomingEventType
, OutgoingResponseType
>
A new Kernel instance.