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
ability to watch "withoutData", useful when retrieving keys #854
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM, suggestion on naming.
kv.go
Outdated
@@ -136,6 +138,14 @@ func IgnoreDeletes() WatchOpt { | |||
}) | |||
} | |||
|
|||
// WithoutData instructs the key watcher not retrieve message data | |||
func WithoutData() WatchOpt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We called this HeadersOnly for the consumers. That may not be the right answer here but this feels weird.
Maybe KeysOnly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted HeadersOnly, but that name already declared in the package. Although I originally though of this as a way to improve the Keys() method performance, I realized that it would not be unreasonable for someone to just watch the key and not care about the value change, just the state change, which comes in the headers. Maybe StateOnly? EntryStateOnly? MetaOnly, EntryMetaOnly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be ok with any of the following. Will let you and @ripienaar decide ;)
KeysOnly
MetaOnly
OnlyKeys
OnlyMeta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My 1st choice is MetaOnly, 2nd is OnlyMeta. I think Keys isn't correct as we will end up returning an entry object with everything except the value, the "meta" part of the entry as described in the ADR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.