dgraph-io / ristretto

A high performance memory-bound Go cache

Home Page:https://dgraph.io/blog/post/introducing-ristretto-high-perf-go-cache/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Non-hashed key values in Item]: onEvict should send the non hashed key values

yusuf-kh opened this issue · comments

Have you tried Ristretto before this proposal? and did not find anything similar?

Yes

What you wanted to do.

I want to know the value of the actual key in onEvict hook. However, after storing a key-value pair in ristretto cache, the onEvict method only returns the key's hash, and not its actual value.

Moreover, I do know I can provide my own hash algorithm, but I want to keep using ristretto's default hashing algorithm. Unfortunately, the Hash algorithm isn't a public method, so I can't use that.

What you actually did.

No response

Why wasn't it great, with examples.

No response

Additional information.

No response

We do not store the key in ristretto, if you care about the key, you could store it in the value.