process icon indicating copy to clipboard operation
process copied to clipboard

Add a waiting callback

Open notdefine opened this issue 3 years ago • 1 comments

Add the possibility to add a callback while waiting for the process to finish. This allows to add Logging or other actions.

class Example {

    private PsrLogger $logger;

    function runMyProcess() {
        $process->wait(
            null, 
            function (ProcessStatus $ProcessStatus): void {
                    $this->logger->debug(
                        'Running Render Videofile process with PID ' . $meltProcessStatus->getSymfonyProcess()->getPid()
                    );
            }
        );
    }
}

notdefine avatar Jan 03 '22 12:01 notdefine

Thanks for your pull request! We love contributions.

However, this repository is what we call a "subtree split": a read-only copy of one directory of the main Symfony repository. It is used by Composer to allow developers to depend on specific Symfony components.

If you want to contribute, you should instead open a pull request on the main repository:

https://github.com/symfony/symfony

Thank you for your contribution!

PS: if you haven't already, please add tests, and beware that bug fixes should be submitted on the lowest maintained branch where they apply.

symfony-bot[bot] avatar Jan 03 '22 12:01 symfony-bot[bot]