import { ValveConfig } from '@deepstream/types'; export default class RuleCache { private data; private purgeInterval; /** * This cache stores rules that are frequently used. It removes * unused rules after a preset interval */ constructor(config: ValveConfig); close(): void; /** * Empties the rulecache completely */ reset(): void; /** * Checks if an entry for a specific rule in a specific section is * present */ has(section: string, name: string, type: string): boolean; /** * Resets the usage flag and returns an entry from the cache */ get(section: string, name: string, type: string): string | undefined; /** * Adds an entry to the cache */ set(section: string, name: string, type: string, rule: string): void; /** * This method is called repeatedly on an interval, defined by * cacheEvacuationInterval. * * If a rule in the cache has been used in the last interval, it sets its isUsed flag to false. * Whenever the rule is used, the isUsed flag will be set to true * Any rules that haven't been used in the next cycle will be removed from the cache */ private purge; }