-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Implement committer #13
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
Conversation
Also small fix to retrying connection so it doesn't leak reads/writes from previous connections.
|
||
class Committer(AsyncContextManager): | ||
""" | ||
A Committer is able to commit subscribers completed offsets. |
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.
super nit: "subscribers' "?
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.
Done.
await self._stop_loopers() | ||
await connection.write(StreamingCommitCursorRequest(initial=self._initial)) | ||
response = await connection.read() | ||
if "initial" not in response: |
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.
Ideally we're not doing substrings to check for errors? This happens in a few places.
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.
This isn't substrings.... its checking for a subfield in the response. This is how you're supposed to check for oneof field presence in the new proto lib.
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.
Ah gotcha!
Also small fix to retrying connection so it doesn't leak reads/writes from previous connections.