-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add ability to get filtered next event from changelog #132
Conversation
pkg/event/iterator.go
Outdated
} | ||
|
||
// NextForFamilyTable blocks and returns the next event that matches the specified family and table | ||
func (i *Iterator) NextForFamilyTable(ctx context.Context, family, table string) (event Event, err error) { |
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.
so if int-consumer wanted to use this, it would be to open an iterator for every table it wanted to track?
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.
Yes, do you see any issues with that?
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.
no, just wanted to clarify since using Next() and NextForFamilyTable() feel pretty incompatible with how they'd behave. My only suggestion would be to perhaps create a filtered_iterator struct with the same Next()
api and have family and table as part of its construction. But I won't block this.
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.
Correct, the use of Next
and NextForFamilyTable
together would not make sense and would not be the intended usage model. Perhaps to make this clearer a separate struct would be better. Will modify and update shortly.
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.
looks great, thank you for doing that
Added new method to Iterator, similar to Next but adds the ability to only return events for family/table user cares about.
Also cut out some verbose logging from the changelog.
Testing completed successfully via unit tests