Files
server/cache.js
2023-09-01 18:58:04 -04:00

20 lines
328 B
JavaScript

// implement a cluster-wide cache which is in-memory for each instance
export class Cache {
constructor(name) {
this.name = name
this.cache = {}
}
async get(key) {
return this.cache[key]
}
async set(key, value) {
this.cache[key] = value
// todo broadcast
}
}