Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Messenger][Process] addRunProcessMessage andRunProcessMessageHandler#49813
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ExecuteProcess andExecuteProcessHandlerExecuteProcess andExecuteProcessHandlersrc/Symfony/Component/Process/Messenger/ExecuteProcessHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
kbond commentedMar 25, 2023
Looking for feedback before proceeding further. |
ExecuteProcess andExecuteProcessHandlerExecuteProcess andExecuteProcessHandlerExecuteProcess andExecuteProcessHandlerExecuteProcess andExecuteProcessHandlerUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
ExecuteProcess andExecuteProcessHandlerProcessMessage andProcessMessageHandler17b805b to9a285c3Comparekbond commentedMar 27, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
Uh oh!
There was an error while loading.Please reload this page.
| ) { | ||
| } | ||
| publicfunction__toString():string |
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.
generally what about just dumping payloads ($dump($messsage)) in CLI for -v[vv]?
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.
Can you explain this a bit more, I'm not understanding what you mean.
ProcessMessage andProcessMessageHandlerRunProcessMessage andRunProcessMessageHandlerkbond commentedJul 28, 2023
I've renamed the classes per the review. I've also added a |
src/Symfony/Component/Process/Messenger/RunProcessFailedException.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Process/Messenger/RunProcessFailedException.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
kbond commentedJul 28, 2023
Comments addressed and PR description updated to show usage. |
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Process/Messenger/RunProcessMessageHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedJul 29, 2023
Thank you@kbond. |
…ommandMessageHandler` (kbond)This PR was squashed before being merged into the 6.4 branch.Discussion----------[Console][Messenger] add `RunCommandMessage` and `RunCommandMessageHandler`| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | n/a| License | MIT| Doc PR | todoSimilar to#49813, when using the scheduler it could be useful to execute commands.## Usage```phpuse Symfony\Component\Console\Exception\RunCommandFailedException;use Symfony\Component\Console\Messenger\RunCommandMessage;try { $context = $bus->dispatch(new RunCommandMessage('my:command')); $context->output; // string - output of command $context->exitCode; // int - the exit codecatch(RunCommandFailedException $e) { // if exit code is non-zero or command threw exception $e->context->output; // string - output of command $e->context->exitCode; // int - the exit code $e->getPrevious(); // null|\Throwable exception command threw if applicable}// "never" fail$context = $bus->dispatch(new RunCommandMessage('my:command', throwOnNonSuccess: false, catchExceptions: true));```TODO:- [x] wire up- [x] testsCommits-------dd5b0b7 [Console][Messenger] add `RunCommandMessage` and `RunCommandMessageHandler`
Uh oh!
There was an error while loading.Please reload this page.
When reviewing how I could replace my cron scheduler with symfony/scheduler, I realized I need a way to schedule processes.
Usage
TODO: