Member Junction
    Preparing search index...

    Interface RegisterForStartupOptions

    Options for the

    decorator

    interface RegisterForStartupOptions {
        deferred?: boolean;
        deferredDelay?: number;
        description?: string;
        priority?: number;
        severity?: "error" | "fatal" | "warn" | "silent";
    }
    Index

    Properties

    deferred?: boolean

    When true, the engine's HandleStartup() is fired during startup but NOT awaited. The shell/app boot sequence proceeds without waiting for the engine to finish loading.

    Use for engines that aren't required for first paint (e.g., admin-only or feature-specific engines like AIEngineBase, IntegrationEngineBase).

    Consumer contract: code that reads engine state MUST call await Engine.Instance.EnsureLoaded() (or Config(false)) first. BaseEngine load is idempotent — a concurrent caller waits for the in-flight load promise rather than re-loading, so the cost is just one microtask when the load is already done or already running.

    Failures during deferred startup are logged according to severity but never propagate up — they cannot abort the app boot since boot has already completed. Default: false.

    deferredDelay?: number

    Optional delay in milliseconds before executing the deferred HandleStartup() method. Only applies when deferred is true. If specified, the startup manager will wait this amount of time using a timer (setTimeout) before initiating the loading sequence for the deferred startup class.

    description?: string

    Human-readable description for logging/debugging

    priority?: number

    Loading priority. Lower numbers load first. Classes with same priority load in parallel. Default: 100

    severity?: "error" | "fatal" | "warn" | "silent"

    What happens if HandleStartup() fails.

    • 'fatal': Stop startup, throw error, process should terminate
    • 'error': Log error, continue loading other classes (default)
    • 'warn': Log warning, continue (for optional functionality)
    • 'silent': Swallow error completely