From 04a2203d05acb4ed4bab61e66861fadaa54ebe8b Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 20 Mar 2023 17:57:19 +0100 Subject: [PATCH] [FrameworkBundle] Make `StopWorkerOnSignalsListener` configurable via messenger's config --- messenger.rst | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index 34e12bc473c..9a74fbd1231 100644 --- a/messenger.rst +++ b/messenger.rst @@ -762,7 +762,59 @@ message before terminating. However, you might prefer to use different POSIX signals for graceful shutdown. You can override default ones by setting the ``framework.messenger.stop_worker_on_signals`` -configuration option. +configuration option: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/messenger.yaml + framework: + messenger: + stop_worker_on_signals: + - "SIGINT" + - "SIGTERM" + - "SIGUSR1" + + # ... + + .. code-block:: xml + + + + + + + + + + + + + + + + + .. code-block:: php + + use Symfony\Config\FrameworkConfig; + + return static function (FrameworkConfig $framework) { + $messenger = $framework->messenger(); + + // ... + + $messenger + ->stopWorkerOnSignals([\SIGINT, \SIGTERM, \SIGUSR1]) + // ... + ; + }; .. versionadded:: 6.3