Repository navigation
Conversation
The kicker hardcoded the `types_of_exceptions` label name to keep it off the wire. That leaks middleware-specific knowledge into core code. Add a `task_only_labels` declaration to TaskiqMiddleware. Labels named there should be read only from the registered task and are skipped when kicker builds a message, so they are not serialized.
This branch has not been deployed
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.
Some middlewares need a task-level parameter that isn't serialized and is read from the registered task instead of from the message, the way
types_of_exceptionsworks for the retry middlewares.Currently this only works for
types_of_exceptions, because the kicker skips it by name when building a message. This means core code knows about parameters used by a specific middleware, and custom middlewares have no way to get the same behavior for their own labels.This PR lets a middleware declare such labels itself via
task_only_labels. The kicker skips them when building a message, and the retry middlewares declaretypes_of_exceptionsthis way instead of the hardcoded check.