Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] IntroduceHandlerDescriptorInterface#50998

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ruudk wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromruudk:handler-descriptor-interface

Conversation

ruudk
Copy link
Contributor

QA
Branch?6.4
Bug fix?no
New feature?yes
Deprecations?no
Tickets
LicenseMIT
Doc PR

TheHandlerDescriptor class is final and therefore cannot be extended. To make this a bit more flexible we introduce theHandlerDescriptorInterface that is used everywhere.

It also introduces a.messenger.handler_descriptor_class parameter that's used in the MessengerPass. With this parameter it's possible to use a custom implementation of theHandlersLocator.

This is an alternative approach to#50980. That PR also describes reasonings for this.

The `HandlerDescriptor` class is final and therefore cannot be extended. To make this a bit moreflexible we introduce the `HandlerDescriptorInterface` that is used everywhere.It also introduces a `.messenger.handler_descriptor_class` parameter that's used in theMessengerPass. With this parameter it's possible to use a custom implementation of the`HandlersLocator`.This is an alternative approach tosymfony#50980.
@ruudk
Copy link
ContributorAuthor

Before I fix the failing tests, I'd like to know if this would be considered for merge or not.

@ruudk
Copy link
ContributorAuthor

@OskarStark what do you think about this?

@derrabus
Copy link
Member

It also introduces a.messenger.handler_descriptor_class parameter that's used in the MessengerPass.

We've removed this kind of parameter from our codebase and I don't think we want to start this again. A big issue with that class parameter is that it only works if the custom class uses the exact same constructor signature as the default implementation.

With this parameter it's possible to use a custom implementation of theHandlersLocator.

You could also just replace or decorate the service.

@ruudk
Copy link
ContributorAuthor

Ahh, didn't think of decorating! Will update the PR to remove the parameter.

@ruudk
Copy link
ContributorAuthor

@derrabus But how to decorate something like this:

foreach ($handlersas$handler) {
$definitions[$definitionId ='.messenger.handler_descriptor.'.ContainerBuilder::hash($bus.':'.$message.':'.$handler[0])] = (newDefinition(HandlerDescriptor::class))->setArguments([newReference($handler[0]),$handler[1]]);
$handlerDescriptors[] =newReference($definitionId);
}

The only way I know, is to walk through the container definitions and find anything that starts with.messenger.handler_descriptor?

@ruudk
Copy link
ContributorAuthor

@nicolas-grekas What do you think of this?

@OskarStark
Copy link
Contributor

friendly ping@derrabus

@nicolas-grekasnicolas-grekas modified the milestones:6.4,7.1Nov 15, 2023
@xabbuhxabbuh modified the milestones:7.1,7.2May 15, 2024
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

7 participants
@ruudk@derrabus@OskarStark@fabpot@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp