Skip to content

Commit 4493238

Browse files
committed
[#2504] Backporting information about stopping a process
1 parent 2e95e18 commit 4493238

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/process.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ are done doing other stuff::
9393
}
9494
});
9595

96+
Stopping a Process
97+
------------------
98+
99+
Any asynchronous process can be stopped at any time with the
100+
:method:`Symfony\\Component\\Process\\Process::stop` method. This method takes
101+
a timeout as its argument. Once the timeout is reached, the process is terminated.
102+
103+
$process = new Process('ls -lsa');
104+
$process->start();
105+
106+
// ... do other things
107+
108+
$process->stop(3);
109+
96110
Executing PHP Code in Isolation
97111
-------------------------------
98112

0 commit comments

Comments
 (0)