Skip to content

Commit 05c632e

Browse files
committed
Merge branch '2.7' into 2.8
2 parents c1b7b04 + 814d8c4 commit 05c632e

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

components/http_foundation.rst

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ represents an HTTP message. But when moving from a legacy system, adding
288288
methods or changing some default behavior might help. In that case, register a
289289
PHP callable that is able to create an instance of your ``Request`` class::
290290

291+
use AppBundle\Http\SpecialRequest;
291292
use Symfony\Component\HttpFoundation\Request;
292293

293294
Request::setFactory(function (

components/process.rst

+20
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,26 @@ are done doing other stuff::
124124
which means that your code will halt at this line until the external
125125
process is completed.
126126

127+
.. note::
128+
129+
If a ``Response`` is sent **before** a child process had a chance to complete,
130+
the server process will be killed (depending on your OS). It means that
131+
your task will be stopped right away. Running an asynchronous process
132+
is not the same as running a process that survives its parent process.
133+
134+
If you want your process to survive the request/response cycle, you can
135+
take advantage of the ``kernel.terminate`` event, and run your command
136+
**synchronously** inside this event. Be aware that ``kernel.terminate``
137+
is called only if you use PHP-FPM.
138+
139+
.. caution::
140+
141+
Beware also that if you do that, the said PHP-FPM process will not be
142+
available to serve any new request until the subprocess is finished. This
143+
means you can quickly block your FPM pool if you're not careful enough.
144+
That is why it's generally way better not to do any fancy things even
145+
after the request is sent, but to use a job queue instead.
146+
127147
:method:`Symfony\\Component\\Process\\Process::wait` takes one optional argument:
128148
a callback that is called repeatedly whilst the process is still running, passing
129149
in the output and its type::

reference/dic_tags.rst

+5
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ wrapping their names with ``%`` characters).
353353
sense most of the times to prevent accessing those services directly instead
354354
of using the generic service alias.
355355

356+
.. note::
357+
358+
You need to manually add the ``Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass``
359+
compiler pass to the container for this feature to work.
360+
356361
console.command
357362
---------------
358363

0 commit comments

Comments
 (0)