-
Notifications
You must be signed in to change notification settings - Fork 4
alert on subscription failure, and shutdown returns an empty list #5
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
base: main
Are you sure you want to change the base?
Conversation
hedwig/backends/gcp.py
Outdated
@@ -261,14 +271,24 @@ def pull_messages( | |||
) | |||
|
|||
for subscription_path in self._subscription_paths: | |||
# need a separate scheduler per subscription since the queue is tied to subscription path |
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.
comment is still valid i think
hedwig/backends/gcp.py
Outdated
self.shutdown_event = shutdown_event | ||
|
||
def shutdown(self, await_msg_callbacks=False) -> List: # type: ignore | ||
self.shutdown_event.set() |
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.
Not sure if setting this shutdown event in the Scheduler is necessary. I think the important bit was to return the empty list instead of None
.
hedwig/backends/gcp.py
Outdated
self.shutdown_event = shutdown_event | ||
|
||
def shutdown(self, await_msg_callbacks=False) -> List: # type: ignore | ||
self.shutdown_event.set() |
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.
hm not sure how I feel about this - the event is technically just an input to this class and owned by the caller. I'd rather we raise an exception here and let caller deal with that instead of this - thoughts?
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.
Yeah, I dont think we need this shutdown event here
No description provided.