JavaScript HSM API Dinamo
    Preparing search index...

    SessionPoolEvents Interface

    Events emitted by any session pool in the process—the bus is shared among all pools; filter by key in the handler when you need to distinguish between identities.

    interface SessionPoolEvents {
        checkout: (info: { key: SessionPoolKey; waitedMs: number }) => void;
        checkin: (info: { key: SessionPoolKey }) => void;
        "session-created": (info: { key: SessionPoolKey }) => void;
        "session-reaped": (info: { key: SessionPoolKey; idleMs: number }) => void;
        "session-discarded": (
            info: { key: SessionPoolKey; reason: "business-call-error" },
        ) => void;
        "queue-full": (
            info: { key: SessionPoolKey; queueLength: number; queueMax: number },
        ) => void;
        "queue-timeout": (info: { key: SessionPoolKey; waitedMs: number }) => void;
    }
    Index
    checkout: (info: { key: SessionPoolKey; waitedMs: number }) => void

    A handle obtained a session (either a reused idle session or a new one via scale-up).

    checkin: (info: { key: SessionPoolKey }) => void

    A session was returned to the pool via .disconnect() on a handle that had not been invalidated.

    "session-created": (info: { key: SessionPoolKey }) => void

    A new physical session has been started (warm-up or scale-up).

    "session-reaped": (info: { key: SessionPoolKey; idleMs: number }) => void

    An idle session above the minimum threshold was closed without penalty due to inactivity (ADR-0010/0012).

    "session-discarded": (
        info: { key: SessionPoolKey; reason: "business-call-error" },
    ) => void

    One session was discarded (abrupt termination, never returned) following an error in a business call (ADR-0011/0020).

    "queue-full": (
        info: { key: SessionPoolKey; queueLength: number; queueMax: number },
    ) => void

    A handle request was rejected because the queue was full.

    "queue-timeout": (info: { key: SessionPoolKey; waitedMs: number }) => void

    A handle request has expired while waiting in the queue.