[Messenger] [WIP] Be able to start a worker for multiple queues with custom consumption priorities #47602
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.
This PR adds a way to run the messenger worker with different, potentially custom execution strategies. Beside extracting the current "execution strategy", it also adds a new one: "com.symfony.ranked", which satisfies the requirements described in the related ticket: #45882.
An example that demonstrates the entire feature:
At present, I would like to gather feedback for my changes before I go ahead and fix/write tests, etc. The code does work, however, as I integration-tested it in my test project.
Regarding BC, the feature might be breaking the compatibility because it adds a new required
__construct()
argument to the following classes:ConsumeMessagesCommand
,Worker
(this one is, however, annotated as final, so perhaps BC might not be a concern here). Please let me know if this indeed is a BC break. If yes, I'd appreciate a proposition on how to work around it (perhaps setter injection could be used instead, but it has its own downsides).