refactored watcher; produces logs
This commit is contained in:
19
cache.js
Normal file
19
cache.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user