@adcp/sdk API Reference - v14.3.0
    Preparing search index...

    Interface RedisLikeClient

    Escape-hatch interface for adopters not using the official redis client (node-redis v4/v5) — e.g., ioredis, Upstash, a test double.

    Mirrors the four methods this backend actually calls. All writes use Lua so ownership checks and absolute retention updates stay atomic.

    import Redis from 'ioredis';
    const ioredis = new Redis(process.env.REDIS_URL!);

    const client: RedisLikeClient = {
    get: (k) => ioredis.get(k),
    del: (k) => ioredis.del(k as string),
    eval: (script, { keys, arguments: args }) =>
    ioredis.eval(script, keys.length, ...keys, ...args),
    ping: () => ioredis.ping(),
    };
    interface RedisLikeClient {
        get(key: string): Promise<string | null>;
        del(key: string | string[]): Promise<number>;
        eval(
            script: string,
            options: { keys: string[]; arguments: string[] },
        ): Promise<unknown>;
        ping(): Promise<string>;
    }
    Index
    • Parameters

      • script: string
      • options: { keys: string[]; arguments: string[] }

      Returns Promise<unknown>