Skip to content

Commit 1d2e1f9

Browse files
committed
minor #18113 [FrameworkBundle] Make StopWorkerOnSignalsListener configurable via messenger's config (alexandre-daubois)
This PR was submitted for the 6.3 branch but it was merged into the 7.4 branch instead. Discussion ---------- [FrameworkBundle] Make `StopWorkerOnSignalsListener` configurable via messenger's config Waiting code merge of symfony/symfony#49750 Commits ------- 9d10fd1 [FrameworkBundle] Make `StopWorkerOnSignalsListener` configurable via messenger's config
2 parents 11cf0d7 + 9d10fd1 commit 1d2e1f9

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

messenger.rst

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -879,35 +879,44 @@ configuration option:
879879
- SIGINT
880880
- SIGUSR1
881881
882+
# ...
883+
882884
.. code-block:: xml
883885
884886
<!-- config/packages/messenger.xml -->
885887
<?xml version="1.0" encoding="UTF-8" ?>
886888
<container xmlns="http://symfony.com/schema/dic/services"
887-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
888-
xmlns:framework="http://symfony.com/schema/dic/symfony"
889-
xsi:schemaLocation="http://symfony.com/schema/dic/services
889+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
890+
xmlns:framework="http://symfony.com/schema/dic/symfony"
891+
xsi:schemaLocation="http://symfony.com/schema/dic/services
890892
https://symfony.com/schema/dic/services/services-1.0.xsd
891-
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
893+
http://symfony.com/schema/dic/symfony
894+
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
892895
893896
<framework:config>
894897
<framework:messenger>
895898
<!-- ... -->
896-
<framework:stop-worker-on-signal>SIGTERM</framework:stop-worker-on-signal>
897-
<framework:stop-worker-on-signal>SIGINT</framework:stop-worker-on-signal>
898-
<framework:stop-worker-on-signal>SIGUSR1</framework:stop-worker-on-signal>
899+
900+
<framework:stop-worker-on-signals signal="SIGTERM"/>
901+
<framework:stop-worker-on-signals signal="SIGINT"/>
902+
<framework:stop-worker-on-signals signal="SIGUSR1"/>
899903
</framework:messenger>
900904
</framework:config>
901905
</container>
902906
903907
.. code-block:: php
904908
905-
// config/packages/messenger.php
906909
use Symfony\Config\FrameworkConfig;
907910
908-
return static function (FrameworkConfig $framework): void {
909-
$framework->messenger()
910-
->stopWorkerOnSignals(['SIGTERM', 'SIGINT', 'SIGUSR1']);
911+
return static function (FrameworkConfig $framework) {
912+
$messenger = $framework->messenger();
913+
914+
// ...
915+
916+
$messenger
917+
->stopWorkerOnSignals([\SIGTERM, \SIGINT, \SIGUSR1])
918+
// ...
919+
;
911920
};
912921
913922
.. versionadded:: 7.3

0 commit comments

Comments
 (0)