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

ability to watch "withoutData", useful when retrieving keys #854

Merged
merged 4 commits into from Oct 31, 2021

Conversation

scottf
Copy link
Contributor

@scottf scottf commented Oct 28, 2021

No description provided.

@coveralls
Copy link

coveralls commented Oct 28, 2021

Coverage Status

Coverage increased (+0.2%) to 84.953% when pulling 5c9ca40 on watch-without-data-via-headers-only into f2416a8 on main.

Copy link
Contributor

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@derekcollison derekcollison left a 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 {
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@scottf scottf merged commit 5c4ad16 into main Oct 31, 2021
@scottf scottf deleted the watch-without-data-via-headers-only branch October 31, 2021 21:01
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.

None yet

4 participants