10000 [FrameworkBundle] Allow to pass signals to `StopWorkerOnSignalsListener` in XML config and as plain strings by alexandre-daubois · Pull Request #49750 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Allow to pass signals to StopWorkerOnSignalsListener in XML config and as plain strings #49750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alexandre-daubois
Copy link
Member
@alexandre-daubois alexandre-daubois commented Mar 20, 2023
Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets NA
License MIT
Doc PR Todo

Follow-up of #49702 to improve DX. This PR allows to provide signals this way:

framework:
    messenger:
        transports:
            async: '%env(MESSENGER_TRANSPORT_DSN)%'

        stop_worker_on_signals:
            - SIGINT
            - SIGUSR1

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
        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">

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

@carsonbot carsonbot added this to the 6.3 milestone Mar 20, 2023
@alexandre-daubois alexandre-daubois force-pushed the stopworker-xml-plain-string branch 2 times, most recently from b99efc1 to f45c688 Compare March 20, 2023 21:25
@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@alexandre-daubois alexandre-daubois force-pushed the stopworker-xml-plain-string branch 2 times, most recently from 3a6b28a to 6b42622 Compare May 26, 2023 08:59
@alexandre-daubois alexandre-daubois force-pushed the stopworker-xml-plain-string branch from 6b42622 to 308cbab Compare May 28, 2023 15:32
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
@alexandre-daubois alexandre-daubois force-pushed the stopworker-xml-plain-string branch from 308cbab to 6efb148 Compare September 18, 2024 09:19
@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
@alexandre-daubois alexandre-daubois force-pushed the stopworker-xml-plain-string branch from 6efb148 to 7c955ee Compare January 18, 2025 09:20
@alexandre-daubois alexandre-daubois force-pushed the stopworker-xml-plain-string branch 2 times, most recently from bcdc68b to 0092092 Compare February 10, 2025 09:42
@alexandre-daubois
Copy link
Member Author

Rebased on 7.3 and changelog entry added. I still think this would be a nice addition for the DX when using signals.

@nicolas-grekas nicolas-grekas force-pushed the stopworker-xml-plain-string branch from 0092092 to cd91c11 Compare February 11, 2025 07:54
@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

@nicolas-grekas nicolas-grekas merged commit 4b6f05d into symfony:7.3 Feb 11, 2025
9 of 11 checks passed
@fabpot fabpot mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0