Skip to content

@codesoul-co/hypha-adapters-local / session-queue

Using this module

Use the Session queue module for using the public contracts and operations for this capability boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  SQLiteSessionQueue,
} from '@codesoul-co/hypha-adapters-local';

import type {
  SQLiteSessionQueueOptions,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
SQLiteSessionQueueclassnew SQLiteSessionQueue(options: SQLiteSessionQueueOptions): SQLiteSessionQueueSQLite Session Queue class with 15 public constructor or member entries; its exact declarations are listed below.
SQLiteSessionQueueOptionsinterfaceinterface SQLiteSessionQueueOptionsSQLite Session Queue Options interface with 10 public fields or methods.

SQLiteSessionQueue

SQLite Session Queue class with 15 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { SQLiteSessionQueue } from '@codesoul-co/hypha-adapters-local';
  • Source module: session-queue

Declaration

text
export declare class SQLiteSessionQueue implements SessionQueue {
    constructor(options: SQLiteSessionQueueOptions);
    enqueue(request: EnqueueSessionCommandRequest): Promise<SessionCommandRecord>;
    claim(request: ClaimSessionCommandRequest): Promise<SessionCommandRecord | null>;
    renew(request: RenewSessionCommandRequest): Promise<SessionCommandClaim>;
    complete(request: CompleteSessionCommandRequest): Promise<void>;
    fail(request: FailSessionCommandRequest): Promise<void>;
    release(request: ReleaseSessionCommandRequest): Promise<void>;
    list(request: ListSessionCommandsRequest): Promise<SessionCommandRecord[]>;
    cancelPending(request: CancelSessionCommandsRequest): Promise<CancelSessionCommandsResult>;
    redriveDeadLetter(request: RedriveDeadLetterSessionCommandRequest): Promise<SessionCommandRecord>;
    closeDeadLetter(request: CloseDeadLetterSessionCommandRequest): Promise<SessionCommandRecord>;
    listStuck(request: ListStuckSessionCommandsRequest): Promise<StuckSessionCommand[]>;
    drain(scope: SessionQueueScope): Promise<void>;
    health(): Promise<ProviderHealth & {
            details: SessionQueueHealthSnapshot;
        }>;
    close(): void;
}

Public members

MemberKindSignatureDescription
cancelPendingmethodcancelPending(request: CancelSessionCommandsRequest): Promise<CancelSessionCommandsResult>Public method; parameters and return type are shown in the signature.
claimmethodclaim(request: ClaimSessionCommandRequest): Promise<SessionCommandRecord | null>Public method; parameters and return type are shown in the signature.
closemethodclose(): voidPublic method; parameters and return type are shown in the signature.
closeDeadLettermethodcloseDeadLetter(request: CloseDeadLetterSessionCommandRequest): Promise<SessionCommandRecord>Public method; parameters and return type are shown in the signature.
completemethodcomplete(request: CompleteSessionCommandRequest): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: SQLiteSessionQueueOptions): SQLiteSessionQueueCreates an instance of this class.
drainmethoddrain(scope: SessionQueueScope): Promise<void>Public method; parameters and return type are shown in the signature.
enqueuemethodenqueue(request: EnqueueSessionCommandRequest): Promise<SessionCommandRecord>Public method; parameters and return type are shown in the signature.
failmethodfail(request: FailSessionCommandRequest): Promise<void>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): Promise<ProviderHealth & { details: SessionQueueHealthSnapshot; }>Public method; parameters and return type are shown in the signature.
listmethodlist(request: ListSessionCommandsRequest): Promise<SessionCommandRecord[]>Public method; parameters and return type are shown in the signature.
listStuckmethodlistStuck(request: ListStuckSessionCommandsRequest): Promise<StuckSessionCommand[]>Public method; parameters and return type are shown in the signature.
redriveDeadLettermethodredriveDeadLetter(request: RedriveDeadLetterSessionCommandRequest): Promise<SessionCommandRecord>Public method; parameters and return type are shown in the signature.
releasemethodrelease(request: ReleaseSessionCommandRequest): Promise<void>Public method; parameters and return type are shown in the signature.
renewmethodrenew(request: RenewSessionCommandRequest): Promise<SessionCommandClaim>Public method; parameters and return type are shown in the signature.

SQLiteSessionQueueOptions

SQLite Session Queue Options interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { SQLiteSessionQueueOptions } from '@codesoul-co/hypha-adapters-local';
  • Source module: session-queue

Declaration

text
export interface SQLiteSessionQueueOptions {
    filename: string;
    now?: () => string;
    duplicatePolicy?: 'reuse' | 'reject';
    maxPendingPerSession?: number;
    maxPendingPerUser?: number;
    maxPendingGlobal?: number;
    maxConcurrentSessions?: number;
    maxConcurrentSessionsPerUser?: number;
    priorityAgingMs?: number;
    drainPollMs?: number;
}

Contract members

MemberKindSignatureDescription
drainPollMspropertydrainPollMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
duplicatePolicypropertyduplicatePolicy?: "reuse" | "reject"Public property; its type, readonly modifier and optionality are shown in the signature.
filenamepropertyfilename: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
maxConcurrentSessionspropertymaxConcurrentSessions?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxConcurrentSessionsPerUserpropertymaxConcurrentSessionsPerUser?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxPendingGlobalpropertymaxPendingGlobal?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxPendingPerSessionpropertymaxPendingPerSession?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxPendingPerUserpropertymaxPendingPerUser?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
priorityAgingMspropertypriorityAgingMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.