mastercache
Version:
Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers
1 lines • 1.37 kB
Source Map (JSON)
{"version":3,"sources":["../../../src/types/bus.ts"],"sourcesContent":["import type { Transport } from '@boringnode/bus/types/main';\n\nimport type { Duration } from './helpers';\n\n/**\n * Interface for the bus driver\n */\nexport type BusDriver = Transport\n\n/**\n * Message sent over the cache bus\n */\nexport type CacheBusMessage = {\n keys: string[]\n type: CacheBusMessageType\n namespace?: string\n}\n\nexport enum CacheBusMessageType {\n /**\n * An item was set in the cache\n */\n Set = 'set',\n\n /**\n * Whole cache was cleared\n */\n Clear = 'clear',\n\n /**\n * An item was deleted from the cache\n */\n Delete = 'delete',\n}\n\nexport type BusOptions = {\n /**\n * Configuration for the bus retry queue\n */\n retryQueue?: {\n /**\n * If we should retry sending messages that failed to be sent\n */\n enabled?: boolean\n\n /**\n * Maximum number of messages to keep in the retry queue. Older\n * messages will be discarded when the queue is full.\n */\n maxSize?: number\n\n /**\n * The interval between each retry attempt\n */\n retryInterval?: Duration | false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,IAAK,sBAAL,kBAAKA,yBAAL;AAIL,EAAAA,qBAAA,SAAM;AAKN,EAAAA,qBAAA,WAAQ;AAKR,EAAAA,qBAAA,YAAS;AAdC,SAAAA;AAAA,GAAA;","names":["CacheBusMessageType"]}