Skip to content

Commit fb26a8f

Browse files
committed
[#2504] Tweaks to new Process signal and pid docs
1 parent 58d4341 commit fb26a8f

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

components/process.rst

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,22 @@ are done doing other stuff::
9898

9999
.. note::
100100

101-
Please consider that the :method:`Symfony\\Component\\Process\\Process::wait`
102-
method is blocking.
101+
The :method:`Symfony\\Component\\Process\\Process::wait` method is blocking,
102+
which means that your code will halt at this line until the external
103+
process is completed.
104+
105+
Stopping a Process
106+
~~~~~~~~~~~~~~~~~~
103107

104108
.. versionadded:: 2.3
105109
The ``signal`` parameter of the ``stop`` method was added in Symfony 2.3.
106110

107111
Any asynchronous process can be stopped at any time with the
108112
:method:`Symfony\\Component\\Process\\Process::stop` method. This method takes
109113
two arguments : a timeout and a signal. Once the timeout is reached, the signal
110-
is sent to the running process.
111-
The default signal sent to a process is ``SIGKILL``. Please read the signal
112-
documentation below to know more about signal handling in the Process component.
113-
114-
.. code-block:: php
114+
is sent to the running process. The default signal sent to a process is ``SIGKILL``.
115+
Please read the :ref:`signal documentation below<reference-process-signal>`
116+
to find out more about signal handling in the Process component::
115117

116118
$process = new Process('ls -lsa');
117119
$process->start();
@@ -172,16 +174,16 @@ check regularly::
172174
usleep(200000);
173175
}
174176

177+
.. _reference-process-signal:
178+
175179
Process Signals
176180
---------------
177181

178182
.. versionadded:: 2.3
179183
The ``signal`` method was added in Symfony 2.3.
180184

181-
When running programs asynchronously, you can send it posix signals with the
182-
:method:`Symfony\\Component\\Process\\Process::signal` method.
183-
184-
.. code-block:: php
185+
When running a program asynchronously, you can send it posix signals with the
186+
:method:`Symfony\\Component\\Process\\Process::signal` method::
185187

186188
use Symfony\Component\Process\Process;
187189

@@ -195,7 +197,7 @@ When running programs asynchronously, you can send it posix signals with the
195197

196198
Due to some limitations in PHP, if you're using signals with the Process
197199
component, you may have to prefix your commands with `exec`_. Please read
198-
`Symfony Issue#5769`_ and `PHP Bug#39992`_ to understand why this is happening.
200+
`Symfony Issue#5759`_ and `PHP Bug#39992`_ to understand why this is happening.
199201

200202
POSIX signals are not available on Windows platforms, please refer to the
201203
`PHP documentation`_ for available signals.
@@ -222,11 +224,11 @@ You can access the `pid`_ of a running process with the
222224

223225
Due to some limitations in PHP, if you want to get the pid of a symfony Process,
224226
you may have to prefix your commands with `exec`_. Please read
225-
`Symfony Issue#5769`_ to understand why this is happening.
227+
`Symfony Issue#5759`_ to understand why this is happening.
226228

227-
.. _Symfony Issue#5759: https://github.com/symfony/symfony/issues/5759
228-
.. _PHP Bug#39992: https://bugs.php.net/bug.php?id=39992
229-
.. _exec: http://en.wikipedia.org/wiki/Exec_(operating_system)
230-
.. _pid: http://en.wikipedia.org/wiki/Process_identifier
231-
.. _PHP Documentation: http://php.net/manual/en/pcntl.constants.php
229+
.. _`Symfony Issue#5759`: https://github.com/symfony/symfony/issues/5759
230+
.. _`PHP Bug#39992`: https://bugs.php.net/bug.php?id=39992
231+
.. _`exec`: http://en.wikipedia.org/wiki/Exec_(operating_system)
232+
.. _`pid`: http://en.wikipedia.org/wiki/Process_identifier
233+
.. _`PHP Documentation`: http://php.net/manual/en/pcntl.constants.php
232234
.. _Packagist: https://packagist.org/packages/symfony/process

0 commit comments

Comments
 (0)