Introduces a new protocol PKeyIterable, which defines the method -keys that returns a channel yielding all toplevel keys in the store, in sorted order. Adds implementations of this for memory and filestore.
This adds a function konserve.core/keys, which might not be the best name since it overrides clojure.core/keys. Alternate name suggestions are welcomed.
src/konserve/core.cljc (keys): new function.
src/konserve/filestore.clj (list-keys): do I/O in a thread.
(FileSystemStore): add PKeyIterable protocol.
src/konserve/memory.cljc (MemoryStore): add PKeyIterable protocol.
(new-mem-store): force state to be a sorted-map.
I was trying to think of ways to do node GC in hitchhiker-tree, and at least some way to iterate keys in the store is a starting point. There might be other approaches, and the keys output might not need to be sorted.
Introduces a new protocol
PKeyIterable
, which defines the method-keys
that returns a channel yielding all toplevel keys in the store, in sorted order. Adds implementations of this for memory and filestore.This adds a function
konserve.core/keys
, which might not be the best name since it overridesclojure.core/keys
. Alternate name suggestions are welcomed.