Open purrgrammer opened 5 years ago
That sounds reasonable to me. How would you do the batching? It would be a breaking change if the channel would close before the IO operations have succeeded. Operations can run in parallel as long as:
Note that the user of the konserve API can still decide not to wait for the channel to close. Writing a patch with a bit of core.async foo, e.g. mapping over all keys to create channels and then go-looping over the lazy seq of channels to aggregate the result (any error), should do the trick I think.
The key-value protocol's dissoc method supports removing one key at a time. Clojure's dissoc supports removing several keys at once:
Would it make sense for
dissoc
in Konserve to accept multiple keys as well?Note that deletions of multiple keys could be batched for a performance gain in the underlying backend implementations. This is a breaking API change so I figured out I should I ask before submitting a patch.
I've also noticed that due to the insertion being based on
assoc-in
there is no way to perform batched updates. We could also consider adding a variant ofassoc-in
(orassoc
) that allows for batched inserts, which projects like Datahike could ultimately benefit from.