Iskra API Reference
    Preparing search index...

    Class App

    Index
    • Parameters

      • Optionalconfig: AppConfig

      Returns App

    config: AppConfig
    context: AppContext = ...
    events: Emitter<Record<string, unknown>>
    logger: Logger
    • Emits event; for events in AppEvents the payload must match their type.

      Type Parameters

      • K extends keyof AppEvents

      Parameters

      • event: K
      • payload: AppEvents[K]

      Returns void

    • Emits event; for events in AppEvents the payload must match their type.

      Parameters

      • event: string
      • Optionalpayload: unknown

      Returns void

    • Returns Promise<void>

    • Runs handler for every event. Events in AppEvents give the handler a typed payload; for others it is unknown, or the type given as T.

      Type Parameters

      • K extends keyof AppEvents

      Parameters

      • event: K
      • handler: (ctx: Context<AppEvents[K]>) => void | Promise<void>

      Returns this

    • Runs handler for every event. Events in AppEvents give the handler a typed payload; for others it is unknown, or the type given as T.

      Type Parameters

      • T = unknown

      Parameters

      • event: string
      • handler: (ctx: Context<T>) => void | Promise<void>

      Returns this

    • Parameters

      Returns App

    • Starts drivers one at a time, in registration order, so a driver can rely on the ones registered before it (e.g. the DB before the web server). If one fails, every driver is stopped in reverse order (all were initialized and may hold connections, including the failing one), OpenTelemetry is shut down and the error is rethrown, instead of leaving ports bound and children running.

      Returns Promise<void>

    • Stops drivers in reverse start order (the web server before the DB it uses), continuing past failures, and always flushes OpenTelemetry.

      A call made while a stop is in progress (e.g. an app's own signal handler next to the App's) gets that same stop: it resolves only once every driver has stopped, instead of right away with nothing left to do.

      Returns Promise<void>

    • Parameters

      Returns App