UNPKG

@jbagatta/johnny-cache

Version:

A robust distributed dictionary for coordinating and caching expensive operations in a distributed environment

16 lines (15 loc) 590 B
import { Redis } from "ioredis"; import { L1CacheManager } from "./l1-cache-manager"; import NodeCache from "node-cache"; export declare class RedisL1CacheManager implements L1CacheManager { private readonly redis; private readonly namespace; private readonly l1Cache; private readonly subscriber; constructor(redis: Redis, namespace: string, l1Cache: NodeCache); get<T>(key: string): T | null; set<T>(key: string, value: T, ttl?: number | string): boolean; delete(key: string): Promise<void>; ttl(key: string, ttlMs: number): void; close(): void; }