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

V1 #8

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

V1 #8

wants to merge 12 commits into from

Conversation

RRostami
Copy link
Contributor

@RRostami RRostami commented May 9, 2020

Reworked the CacheLayer files and made it an interface.
Added support for client-side hash sharding.
Added rediscluster configuration which supports both sharding and Redis cluster.
Moved internal contexts into a better place.
(Breaking Change: outward-facing TTL now requires a context as well)
Reworked internal configs (paving the way for more flexible input config on a later date)
Also added some config examples

@mmohamadi
Copy link

mmohamadi commented May 10, 2020

Hi. I think it would be much better to collect common properties of different cache types into a new type.
For example there could be a type called commonCacheProperties which is implemented as
type commonCacheProperties struct {
layerName string
amnesiaChance int
compressionEnabled bool
cacheTTL time.Duration
watcher ITimer
}

then the new type can be embedded in each cache type
for example
type tinyCache struct {
commonCacheProperties
base *sync.Map
}

so, the need to repeat all of them over and over again is eliminated.

@pedramteymoori pedramteymoori self-requested a review May 17, 2020 11:17
@RRostami RRostami marked this pull request as ready for review May 17, 2020 11:18
Copy link
Contributor

@pedramteymoori pedramteymoori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done @RRostami . I opened two tiny discussions. There is also one good suggestion from @mmohamadi here which is considerable.
I also found one ambiguity in our readme regarding integrating Epimetheus which is better to be addressed explicitly.
This PR will be ready for merge after these modifications.

utils.go Outdated Show resolved Hide resolved
@cafebazaar cafebazaar deleted a comment from RRostami May 17, 2020
@RRostami RRostami changed the title V2 V1 May 18, 2020
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.

3 participants