Fix InMemoryBroker to use startup and shutdown middleware hooks#358
Open
hawang-wish wants to merge 1 commit intotaskiq-python:masterfrom
Open
Fix InMemoryBroker to use startup and shutdown middleware hooks#358hawang-wish wants to merge 1 commit intotaskiq-python:masterfrom
hawang-wish wants to merge 1 commit intotaskiq-python:masterfrom
Conversation
s3rius
requested changes
Sep 6, 2024
Member
s3rius
left a comment
There was a problem hiding this comment.
The request looks good to me. But I have a small question.
Comment on lines
+176
to
+181
| for handler in self.event_handlers.get( | ||
| TaskiqEvents.CLIENT_STARTUP | ||
| if self.is_worker_process | ||
| else TaskiqEvents.WORKER_STARTUP, | ||
| [], | ||
| ): |
Member
There was a problem hiding this comment.
Shouldn't it be reversed?
Suggested change
| for handler in self.event_handlers.get( | |
| TaskiqEvents.CLIENT_STARTUP | |
| if self.is_worker_process | |
| else TaskiqEvents.WORKER_STARTUP, | |
| [], | |
| ): | |
| for handler in self.event_handlers.get( | |
| TaskiqEvents.WORKER_STARTUP | |
| if self.is_worker_process | |
| else TaskiqEvents.CLIENT_STARTUP, | |
| [], | |
| ): |
Comment on lines
+188
to
+190
| TaskiqEvents.CLIENT_SHUTDOWN | ||
| if self.is_worker_process | ||
| else TaskiqEvents.WORKER_SHUTDOWN, |
Member
There was a problem hiding this comment.
This one as well.
Suggested change
| TaskiqEvents.CLIENT_SHUTDOWN | |
| if self.is_worker_process | |
| else TaskiqEvents.WORKER_SHUTDOWN, | |
| TaskiqEvents.WORKER_SHUTDOWN | |
| if self.is_worker_process | |
| else TaskiqEvents.CLIENT_SHUTDOWN, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This is the second patch I would like to introduce. Previously, we overrode the
startupandshutdownto ensure bothclientandworkerevents would be handled properly. However, this made InMemoryBroker unable to handlestartupandshutdownmiddleware hooks.This change brings the handling of
startupandshutdownmiddleware hooks back. Feel free to let me know if you have any concerns or suggestions!