Field Notes
    Preparing search index...

    Interface BackendPluginContext

    interface BackendPluginContext {
        client: RedisHashClient;
        roomKeyPrefix: string;
        addDisposer(dispose: () => void): void;
        registerService<T>(key: ServiceKey<T>, service: NoInfer<T>): void;
        roomKey(room: string): string;
        touchRoom(room: string): Promise<void>;
    }
    Index
    roomKeyPrefix: string

    Raw key prefix shared by every room-scoped hash. Prefer roomKey.

    • Parameters

      • dispose: () => void

      Returns void

    • Type Parameters

      • T

      Parameters

      • key: ServiceKey<T>
      • service: NoInfer<T>

      Returns void

    • The escaped base key for room; derive sub-keys as ${roomKey(room)}:<suffix>. Building keys from roomKeyPrefix and the raw room name lets a hostile room name alias another room's sub-key hashes.

      Parameters

      • room: string

      Returns string

    • Refreshes the room's expiry when the backend sets ttlSeconds; a no-op otherwise. Never rejects.

      Parameters

      • room: string

      Returns Promise<void>