UNPKG

@jbagatta/johnny-cache

Version:

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

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