You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The key-value protocol's dissoc method supports removing one key at a time. Clojure's dissoc supports removing several keys at once:
(dissoc {:a1:b2:c3} :c:b)
;;=> {:a 1}
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 of assoc-in (or assoc) that allows for batched inserts, which projects like Datahike could ultimately benefit from.
The text was updated successfully, but these errors were encountered:
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:
Any arising error propagates as a value in the resulting channel.
The whole operation does not succeed before all batched operations have succeeded.
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.The text was updated successfully, but these errors were encountered: