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

[2.1] Support for long running non-blocking processes in the process component #1409

Closed
b00gizm opened this issue Jun 22, 2011 · 4 comments
Closed
Labels
Milestone

Comments

@b00gizm
Copy link

b00gizm commented Jun 22, 2011

There's currently no support for long running processes in the process component. It would be cool to have dedicated Process subclass for this kind of task (e.g. for starting and stopping a Node.js server from a PHP/Symfomy application).

@fabpot
Copy link
Member

fabpot commented Jun 22, 2011

I don't see anything that prevents you from running executing long running processes with the Process component. Can you be more explicit about what's missing?

@b00gizm
Copy link
Author

b00gizm commented Jun 24, 2011

Okay, my posting might have been a bit misleading.

With the current Process class, I can start a process, but it blocks the main thread, because it sits there and waits for new data to process until it eventually dies after finishing or after timeout.

It would be nice to have an API like the childprocess gem in Ruby:

$process = new Symfony\Component\Process\Process("env node server.js");
$process->run();

// do other stuff ...

if ($process->isAlive()) {
   $process->stop();
}

@pcampr
Copy link
Contributor

pcampr commented Nov 28, 2011

+1

This would be really useful (e.g. for parallel downloads). With plain PHP you can start more than one process with proc_open(), here with Process class you can have only one running at one time (because of while loops in run() method waiting for the process to stop).

@fabpot
Copy link
Member

fabpot commented Mar 23, 2012

fixed by #3681

@fabpot fabpot closed this as completed Mar 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants