Skip to main content

@microde/application / MicrodeModule

Abstract Class: MicrodeModule

Defined in: microde-module.ts:19

Defines the lifecycle shared by every module installed in a Microde application.

Lifecycle methods run in phase order. Initialization and setup run in installation order, while teardown, shutdown, and cleanup run in reverse installation order. Each module declares its kind and can override the default no-op run and stop.

Constructors​

Constructor​

new MicrodeModule(context): MicrodeModule

Defined in: microde-module.ts:27

Creates a module operating within the supplied application context.

Parameters​

context​

MicrodeContext

Returns​

MicrodeModule

Properties​

kind​

abstract readonly kind: ModuleKind

Defined in: microde-module.ts:20


providers​

readonly providers: readonly Provider<unknown>[] = []

Defined in: microde-module.ts:24

Owned contract values exported by this module instance.


relationships​

readonly relationships: readonly RelationshipHandle[] = []

Defined in: microde-module.ts:22

Relationship slots declared by this module instance.

Methods​

cleanup()​

cleanup(): Promise<void>

Defined in: microde-module.ts:48

Performs final cleanup, including when an earlier lifecycle phase failed.

Returns​

Promise<void>


initialize()​

initialize(): Promise<void>

Defined in: microde-module.ts:30

Acquires resources needed to configure the module.

Returns​

Promise<void>


run()​

run(_context): Promise<void>

Defined in: microde-module.ts:36

Performs the module's work. Does nothing by default.

Parameters​

_context​

RunContext

Returns​

Promise<void>


setup()​

setup(_context): Promise<void>

Defined in: microde-module.ts:33

Connects the initialized module to the rest of the service.

Parameters​

_context​

SetupContext

Returns​

Promise<void>


shutdown()​

shutdown(): Promise<void>

Defined in: microde-module.ts:45

Releases resources acquired during initialization.

Returns​

Promise<void>


stop()​

stop(): Promise<void>

Defined in: microde-module.ts:39

Requests that the module finish or release its running work. Does nothing by default.

Returns​

Promise<void>


teardown()​

teardown(): Promise<void>

Defined in: microde-module.ts:42

Reverses work performed during setup.

Returns​

Promise<void>