Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can we make scala cache key as generic object instead of string? #549

Open
vimitdhawan opened this issue Jun 30, 2021 · 3 comments
Open

Comments

@vimitdhawan
Copy link

Hi,
I have recently using scala cache in my application. I have a key as an object. I have to explicitly define the string as a key from the same object. can we make it generic and then it's up to the user to define it as a string or object. is there anything I am missing?

@zarthross
Copy link
Contributor

I haven't dived it the code myself, but using stringly keys is probably a compromise here. If we allowed generic object, the the redis/memcached which are remote, probably wouldn't be possible to implement since you'll need to serialize the keys somehow. You would need some type, that is generally serializable, independent of the cache implementation, and string is a straight forward one.

There may be other alternatives...

@vimitdhawan
Copy link
Author

do we have a tightly coupled contract between all the implementations?

@ronnnnnnnnnnnnn
Copy link
Contributor

As far as I understand this is a planned future change. I actually just made a pull request to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants