Documentation
    Preparing search index...

    Interface ActorInstance<S, CP, CS, V, I, DB>

    interface ActorInstance<S, CP, CS, V, I, DB extends AnyDatabaseProvider> {
        actorContext: ActorContext<S, CP, CS, V, I, DB>;
        connectionManager: ConnectionManager<S, CP, CS, V, I, DB>;
        driver: ActorDriver;
        eventManager: EventManager<S, CP, CS, V, I, DB>;
        get abortSignal(): AbortSignal;
        get actions(): string[];
        get config(): ActorConfig<S, CP, CS, V, I, DB>;
        get conns(): Map<string, Conn<S, CP, CS, V, I, DB>>;
        get connStateEnabled(): boolean;
        get db(): InferDatabaseClient<DB>;
        get id(): string;
        get inlineClient(): Client<Registry<any>>;
        get inspector(): ActorInspector;
        get inspectorToken(): string | undefined;
        get isStopping(): boolean;
        get key(): string[];
        get log(): Logger;
        get name(): string;
        get persist(): PersistedActor<S, CP, CS, I>;
        get region(): string;
        get rLog(): Logger;
        get schedule(): Schedule;
        get state(): S;
        set state(value: S): void;
        get stateEnabled(): boolean;
        get vars(): V;
        assertReady(allowStoppingState?: boolean): void;
        beginHonoHttpRequest(): void;
        endHonoHttpRequest(): void;
        executeAction(
            ctx: ActionContext<S, CP, CS, V, I, DB>,
            actionName: string,
            args: unknown[],
        ): Promise<unknown>;
        handleRawRequest(
            conn: Conn<S, CP, CS, V, I, DB>,
            request: Request,
        ): Promise<Response>;
        handleRawWebSocket(
            conn: Conn<S, CP, CS, V, I, DB>,
            websocket: UniversalWebSocket,
            request?: Request,
        ): void;
        isReady(): boolean;
        onAlarm(): Promise<void>;
        onStop(): Promise<void>;
        processMessage(
            message: {
                body:
                    | {
                        tag: "ActionRequest";
                        val: { args: unknown; id: bigint; name: string };
                    }
                    | {
                        tag: "SubscriptionRequest";
                        val: { eventName: string; subscribe: boolean };
                    };
            },
            conn: Conn<S, CP, CS, V, I, DB>,
        ): Promise<void>;
        resetSleepTimer(): void;
        saveState(opts: SaveStateOptions): Promise<void>;
        scheduleEvent(
            timestamp: number,
            action: string,
            args: unknown[],
        ): Promise<void>;
        start(
            actorDriver: ActorDriver,
            inlineClient: Client<Registry<any>>,
            actorId: string,
            name: string,
            key: string[],
            region: string,
        ): Promise<void>;
        startSleep(): void;
        waitUntil(promise: Promise<void>): void;
    }

    Type Parameters

    • S
    • CP
    • CS
    • V
    • I
    • DB extends AnyDatabaseProvider
    Index

    Properties

    actorContext: ActorContext<S, CP, CS, V, I, DB>
    connectionManager: ConnectionManager<S, CP, CS, V, I, DB>
    driver: ActorDriver
    eventManager: EventManager<S, CP, CS, V, I, DB>

    Accessors

    Methods

    • Parameters

      • message: {
            body:
                | {
                    tag: "ActionRequest";
                    val: { args: unknown; id: bigint; name: string };
                }
                | {
                    tag: "SubscriptionRequest";
                    val: { eventName: string; subscribe: boolean };
                };
        }
      • conn: Conn<S, CP, CS, V, I, DB>

      Returns Promise<void>