Skip to content

Conversation

pkieltyka
Copy link
Member

introducing new cachestorectl package and cachestore.Backend type which lets us specify a backend cachestore, and where we can defer the opening of the store in some later part of the code. We also also override options at opening, or set the defaults on the backend.

This is useful for situations where in your program you want to init the cachestore.Backend, depending on the config it might be memlru or redis (or other), and then later in your program you want to pass the cachestore.Backend without specifying the actually Store[V] type, and instantiating the store later. The main benefit is for generics / type-safety, so you can open the backend with any kind of type depending on which type the part of your code wants to cache.

@pkieltyka pkieltyka merged commit d07e4b8 into master Dec 17, 2022
@pkieltyka pkieltyka deleted the cachestorectl branch December 17, 2022 12:42
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.

1 participant