-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Let’s assume that we make new classes rather than using Map and Set (see #8 and #5).
Given that, we now have two or three possible parameters:
- A required string indicating the cache policy (Which cache-replacement policies to include #2), assuming that we go with Consider CacheMap and CacheSet as a third alternative? #8. (If we go with Map.LRU etc. as per Constructor names: LRUMap vs. Map.LRU #5, then we would not have this parameter.)
- An optional positive integer indicating the cache’s max cardinality.
- An optional boolean, a string, or something that indicates whether to purge or cull itself in response to low-memory warnings from the host (Cache-reduction triggers #7).
There are several API choices that I can think of:
new CacheMap('lru', [ 256, 'purgeable' ], entries)
new CacheMap('lru', { maxSize: 256, purgeable: true }, entries)
new CacheMap('lru', entries, { maxSize: 256, purgeable: true })
new CacheMap('lru', { maxSize: 256, purgeable: true, entries })
new CacheMap({ policy: 'lru', maxSize: 256, purgeable: true, entries })
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested