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

feat: Support for a key that would implement it's own key generator #123

Merged
merged 1 commit into from Jan 23, 2022

Conversation

meDavidNS
Copy link
Contributor

Feature request
Especially when using the LoadableCache, you would typically provide the arguments of the loadFunc as a key and inside the cache the key would be generated as the md5 checksum of the type and value when the key is not already a string. I would like the keys to be human readable and thus implement my owner type to string conversion.

With this PR the user is able to implent it's own GetCacheKey() function when required. The only BC break I see is when an existing user already implemented this function and wasn't expeciting it to be used by the cache to generate the cache key.

@meDavidNS meDavidNS changed the title Added support for a key that would implement it's own key generator feat: Support for a key that would implement it's own key generator Jan 13, 2022
@eko
Copy link
Owner

eko commented Jan 16, 2022

Hi @meDavidNS,

This is cool, thank you!
Could you please also add a little example on README file?

@eko eko merged commit c4b57e7 into eko:master Jan 23, 2022
@eko
Copy link
Owner

eko commented Jan 23, 2022

Thank you @meDavidNS, I will add the section in README file.

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

Successfully merging this pull request may close these issues.

None yet

2 participants