Skip to content
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

process object to get lastOutputTime #28026

Closed
lichnow opened this issue Jul 22, 2018 · 1 comment
Closed

process object to get lastOutputTime #28026

lichnow opened this issue Jul 22, 2018 · 1 comment
Labels
Feature Good first issue Ideal for your first contribution! (some Symfony experience may be required) Process

Comments

@lichnow
Copy link

lichnow commented Jul 22, 2018

Description
I run watch webpack build by symfony process,but when i can not check if is building before wait.so ,i should a public method in process class to get lastOutputTime to check it.

Example

$this->runner($params, $messages, true,function(Process $process,$progressBar){
                $process->setTimeout(null);
                $process->start();
                $process->wait(function ($type, $buffer) use($progressBar) {
                    if (microtime(true) - $process->getLastOutputTime() > 10){
                        $this->output->writeln("<fg=yellow>start to watch</>");
                    }
                });
            });
@fabpot
Copy link
Member

fabpot commented Aug 6, 2019

@lichnow Would you like to submit a pull request?

@fabpot fabpot added the Good first issue Ideal for your first contribution! (some Symfony experience may be required) label Aug 6, 2019
@fabpot fabpot closed this as completed Aug 18, 2019
fabpot added a commit that referenced this issue Aug 18, 2019
This PR was squashed before being merged into the 5.0-dev branch (closes #33098).

Discussion
----------

added `Process::getLastOutputTime()` method

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28026
| License       | MIT
| Doc PR        | -

Commits
-------

6359145 added `Process::getLastOutputTime()` method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Good first issue Ideal for your first contribution! (some Symfony experience may be required) Process
Projects
None yet
Development

No branches or pull requests

3 participants