/** * The Cache is a key/value store and used to store commonly accessed metadata * (mainly the execution rules for the app) to save time accessing them as they * are immutable per verison. Rules are only ejected when a new version * (a new distributed executable) is deployed to the quorum * and the cache is invalidated/cleared of the prior version. */ import { ActivityType } from '../../types/activity'; import { HookRule } from '../../types/hook'; import { HotMeshApp, HotMeshSettings } from '../../types/hotmesh'; import { Symbols } from '../../types/serializer'; import { Transitions } from '../../types/transition'; declare class Cache { settings: HotMeshSettings; appId: string; apps: Record; schemas: Record; subscriptions: Record>; symbols: Record; symvals: Record; transitions: Record>; hookRules: Record>; workItems: Record; /** * The cache is ALWAYS initialized with HotMeshSettings. The other parameters are optional. * @param settings * @param apps * @param schemas * @param subscriptions * @param transitions * @param hookRules */ constructor(appId: string, settings: HotMeshSettings, apps?: Record, schemas?: Record, subscriptions?: Record>, symbols?: Record, symvals?: Record, transitions?: Record>, hookRules?: Record>, workItems?: Record); /** * invalidate the cache; settings are not invalidated! */ invalidate(): void; getSettings(): HotMeshSettings; setSettings(settings: HotMeshSettings): void; getApps(): Record; getApp(appId: string): HotMeshApp; setApps(apps: Record): void; setApp(appId: string, app: HotMeshApp): void; getSchemas(appId: string, version: string): Record; getSchema(appId: string, version: string, activityId: string): ActivityType; setSchemas(appId: string, version: string, schemas: Record): void; setSchema(appId: string, version: string, activityId: string, schema: ActivityType): void; getSubscriptions(appId: string, version: string): Record; getSubscription(appId: string, version: string, topic: string): unknown; setSubscriptions(appId: string, version: string, subscriptions: Record): void; getSymbols(appId: string, targetEntityId: string): Symbols; setSymbols(appId: string, targetEntityId: string, symbols: Symbols): void; deleteSymbols(appId: string, targetEntityId: string): void; getSymbolValues(appId: string): Symbols; setSymbolValues(appId: string, symvals: Symbols): void; deleteSymbolValues(appId: string): void; getTransitions(appId: string, version: string): Transitions; setTransitions(appId: string, version: string, transitions: Transitions): void; getHookRules(appId: string): Record; setHookRules(appId: string, hookRules: Record): void; getSignals(appId: string, version: string): Record; setSignals(appId: string, version: string): Record; getActiveTaskQueue(appId: string): string; setWorkItem(appId: string, workItem: string): void; removeWorkItem(appId: string): void; } export { Cache };