-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Deprecate HandleTrait
in favor of a new SingleHandlingTrait
#52952
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
Conversation
ff7e5f4
to
574c4ea
Compare
HandleTrait
in favor of the new SingleHandlingTrait
HandleTrait
in favor of a new SingleHandlingTrait
b587f76
to
48a75e3
Compare
/** | ||
* Dispatches the given message, expecting to be handled by a single handler | ||
* and returns the result from the handler returned value. | ||
* This behavior is useful for both synchronous command & query buses, |
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.
fact is we're querying for a value, hence i prefer naming QueryBusTrait::query
, but not a blocker :)
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.
I don’t want this trait’s name to imply a single use-case as there can be many (a command bus returning IDs e.g.).
EDIT: heh, just found #29167 (comment) 😁
48a75e3
to
c19ecda
Compare
c19ecda
to
da5c907
Compare
The value brought by this change doesn't seem worth the cost of deprecating HandleTrait entirely to me. Also the name |
Changing for a more explicit name and handling exceptions correctly felt enough for me, but will close then. |
In competition with #52949
When using the
HandleTrait
, theHandlerFailedException
just adds noise as the wrapped exception is the one we would expect to be thrown.This PR aims to replace the
HandleTrait
by a newSingleHandlingTrait
, the latter throwing any single exception wrapped in aHandlerFailedException
. In addition, it checks for a single handler even if one failed.