Skip to content

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.

@cafebazaar cafebazaar deleted a comment from RRostami May 17, 2020
@RRostami RRostami requested a review from pedramteymoori May 17, 2020 12:59
@RRostami RRostami changed the title V2 V1 May 18, 2020
@pedramteymoori pedramteymoori force-pushed the master branch 2 times, most recently from 9f18a8f to 3f9e022 Compare May 26, 2020 15:22
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.

4 participants