@grandlinex/kernel
    Preparing search index...

    Class CoreModule

    CoreModule is the primary module that orchestrates the core services of the application. It extends CoreKernelModule with specific type parameters and implements ICoreModule. The module is responsible for initializing the core database, setting up an in-memory cache, and registering essential background services.

    ICoreModule

    Hierarchy (View Summary)

    Implements

    Index
    cdb: CoreDBCon<any>
    channel: string
    logger: CoreLogger | null
    trigger?: () => Promise<void>

    Optional trigger function to be executed during registration.

    • Adds one or more actions to the module.

      Parameters

      Returns void

    • Adds one or more services to the module.

      Parameters

      Returns void

    • Adds a source bridge.

      Parameters

      Returns void

    • Adds a target bridge.

      Parameters

      Returns void

    • Hook called before services are started.

      Returns Promise<void>

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Finalization logic for the module.

      Returns Promise<void>

    • Returns a bridge module by name.

      Type Parameters

      Parameters

      • name: string

        Name of the module

      Returns M

      The bridge module

    • Returns the list of source bridges.

      Returns ICoreBridge[]

    • Returns the cache instance.

      Returns InMemCache

      Error if cache is not set

    • Returns the client instance.

      Returns null

      Error if client is not set

    • Returns the database instance.

      Returns CoreDb

      Error if database is not set

    • Returns the list of dependency names.

      Returns string[]

    • Returns the logger instance from the kernel.

      Returns CoreLogger

    • Returns the name of the module.

      Returns string

    • Returns the presenter instance.

      Returns null

      Error if presenter is not set

    • Returns true if a cache is set.

      Returns boolean

    • Returns true if a client is set.

      Returns boolean

    • Returns true if a database is set.

      Returns boolean

    • Returns true if a presenter is set.

      Returns boolean

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Abstract method to initialize the module.

      Returns Promise<void>

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Notifies all target bridges of a state change.

      Parameters

      Returns void

    • Registers the module, actions, and services.

      Parameters

      • Optionalaction: string

        Optional kernel event to trigger

      Returns Promise<void>

    • Sets the cache instance.

      Parameters

      Returns void

    • Sets the client instance.

      Parameters

      • client: null

        The client to set

      Returns void

    • Sets the database instance.

      Parameters

      • db: CoreDb

        The database to set

      Returns void

    • Sets the presenter instance.

      Parameters

      • presenter: null

        The presenter to set

      Returns void

    • Shuts down the module and its services.

      Returns Promise<void>

    • Starts the presenter and the module.

      Returns Promise<void>

    • Startup logic for the module.

      Returns Promise<void>

    • Stops a service by name.

      Parameters

      • name: string

        Name of the service

      Returns Promise<
          | ICoreService<ICoreKernel<any, ICoreAnyModule>, any, any, any, any>
          | null,
      >

      The stopped service or null

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Waits for all source bridges to reach a specific state.

      Parameters

      Returns Promise<void>

    • Parameters

      • ...ags: unknown[]

      Returns void