Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

callback_on_evict doesn't provide value_size #229

Open
kilobyte opened this issue Apr 11, 2019 · 0 comments
Open

callback_on_evict doesn't provide value_size #229

kilobyte opened this issue Apr 11, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@kilobyte
Copy link
Contributor

I expect that most of the time an user writes an on_evict callback, it's to do something to the entry that's being evicted. That usually requires knowing the value's size.

With our current API, this requires two gets, going through the index and repl twice. That's a waste of time — we already know value_size.

It'd be nice to pass it to the callback. Alas, that'd be an API break...

I'm thus saving this as a note we may want to consider in case we'd want to break the API before 1.0. Another option would be to have a callback2, but that's ugly.

@marcinslusarz marcinslusarz added the enhancement New feature or request label Apr 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants