Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -879,35 +879,44 @@ configuration option:
- SIGINT
- SIGUSR1

# ...

.. code-block:: xml

<!-- config/packages/messenger.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
http://symfony.com/schema/dic/symfony
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

<framework:config>
<framework:messenger>
<!-- ... -->
<framework:stop-worker-on-signal>SIGTERM</framework:stop-worker-on-signal>
<framework:stop-worker-on-signal>SIGINT</framework:stop-worker-on-signal>
<framework:stop-worker-on-signal>SIGUSR1</framework:stop-worker-on-signal>

<framework:stop-worker-on-signals signal="SIGTERM"/>
<framework:stop-worker-on-signals signal="SIGINT"/>
<framework:stop-worker-on-signals signal="SIGUSR1"/>
</framework:messenger>
</framework:config>
</container>

.. code-block:: php

// config/packages/messenger.php
use Symfony\Config\FrameworkConfig;

return static function (FrameworkConfig $framework): void {
$framework->messenger()
->stopWorkerOnSignals(['SIGTERM', 'SIGINT', 'SIGUSR1']);
return static function (FrameworkConfig $framework) {
$messenger = $framework->messenger();

// ...

$messenger
->stopWorkerOnSignals([\SIGTERM, \SIGINT, \SIGUSR1])
// ...
;
};

.. versionadded:: 7.3
Expand Down
Loading