Skip to content

chore: Make AssignmentCacheKey properties public #55

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leoromanovsky
Copy link
Member

@leoromanovsky leoromanovsky commented Mar 24, 2025

motivation

Customers are unable to provide their own implementation of an AssignmentCache because the properties of AssignmentCacheKey are not public

description

Make properties of AssignmentCacheKey public.

@leoromanovsky leoromanovsky marked this pull request as ready for review March 24, 2025 23:29
Comment on lines +9 to +12
public var subjectKey: String
public var flagKey: String
public var allocationKey: String
public var variationKey: String
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at this definition, it seems off? In a sense that it is not a real cache key (but rather a “cache entry”)—the user has to re-implement CacheKey/CacheValue which are still hidden and it may be rather tricky

If we want to make assignment cache public / implementable by users, I would argue that it should work on either CacheKey+CacheValue, or it should accept the whole assignment event (so users have the freedom of what they want to cache on). But at this point, it becomes rather rudimentary and it's probably easier for users to implement a wrapper around their own logger, which is rather easy to do

Copy link
Member Author

Choose a reason for hiding this comment

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

You're definitely right about that - ok before making this public I think it makes sense to tidy up the interface by splitting it out.

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