Documentation
    Preparing search index...

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

    Represents a client connection to a actor.

    Manages connection-specific data and controls the connection lifecycle.

    interface Conn<S, CP, CS, V, I, DB extends AnyDatabaseProvider> {
        "[CONN_CONNECTED_SYMBOL]": boolean;
        "[CONN_DRIVER_SYMBOL]"?: ConnDriver;
        subscriptions: Set<string>;
        get "[CONN_ACTOR_SYMBOL]"(): ActorInstance<S, CP, CS, V, I, DB>;
        get "[CONN_PERSIST_RAW_SYMBOL]"(): PersistedConn<CP, CS>;
        get "[CONN_PERSIST_SYMBOL]"(): PersistedConn<CP, CS>;
        get "[CONN_STATE_ENABLED_SYMBOL]"(): boolean;
        get id(): string;
        get isHibernatable(): boolean;
        get lastSeen(): number;
        get params(): CP;
        get state(): CS;
        set state(value: CS): void;
        "[CONN_HAS_CHANGES_SYMBOL]"(): boolean;
        "[CONN_MARK_SAVED_SYMBOL]"(): void;
        "[CONN_SEND_MESSAGE_SYMBOL]"(
            message: CachedSerializer<any, any, any>,
        ): void;
        "[CONN_SPEAKS_RIVETKIT_SYMBOL]"(): boolean;
        disconnect(reason?: string): Promise<void>;
        send(eventName: string, ...args: unknown[]): void;
    }

    Type Parameters

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

    Properties

    "[CONN_CONNECTED_SYMBOL]": boolean = false

    Connections exist before being connected to an actor. If true, this connection has been connected.

    "[CONN_DRIVER_SYMBOL]"?: ConnDriver

    If undefined, then nothing is connected to this.

    subscriptions: Set<string> = ...

    Accessors

    Methods