Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[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
andExecuteProcessHandler
ExecuteProcess
andExecuteProcessHandler
src/Symfony/Component/Process/Messenger/ExecuteProcessHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Looking for feedback before proceeding further. |
ExecuteProcess
andExecuteProcessHandler
ExecuteProcess
andExecuteProcessHandler
ExecuteProcess
andExecuteProcessHandler
ExecuteProcess
andExecuteProcessHandler
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.
Uh oh!
There was an error while loading.Please reload this page.
ExecuteProcess
andExecuteProcessHandler
ProcessMessage
andProcessMessageHandler
17b805b
to9a285c3
Comparekbond 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.
) { | ||
} | ||
public function __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
andProcessMessageHandler
RunProcessMessage
andRunProcessMessageHandler
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.
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.
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: