Skip to content

Commit 010a795

Browse files
weaverryanfabpot
authored andcommitted
[Messenger] New messenger:stop-workers Command
1 parent ff46dd2 commit 010a795

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Resources/config/cache.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<tag name="cache.pool" />
3737
</service>
3838

39+
<service id="cache.messenger.restart_workers_signal" parent="cache.app" public="false">
40+
<tag name="cache.pool" />
41+
</service>
42+
3943
<service id="cache.adapter.system" class="Symfony\Component\Cache\Adapter\AdapterInterface" abstract="true">
4044
<factory class="Symfony\Component\Cache\Adapter\AbstractAdapter" method="createSystemCache" />
4145
<tag name="cache.pool" clearer="cache.system_clearer" />

Resources/config/console.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
<argument type="collection" /> <!-- Receiver names -->
8484
<argument type="service" id="messenger.retry_strategy_locator" />
8585
<argument type="service" id="event_dispatcher" />
86+
<call method="setCachePoolForRestartSignal">
87+
<argument type="service" id="cache.messenger.restart_workers_signal" />
88+
</call>
8689

8790
<tag name="console.command" command="messenger:consume" />
8891
<tag name="console.command" command="messenger:consume-messages" />
@@ -101,6 +104,11 @@
101104
<tag name="console.command" command="debug:messenger" />
102105
</service>
103106

107+
<service id="console.command.messenger_stop_workers" class="Symfony\Component\Messenger\Command\StopWorkersCommand">
108+
<argument type="service" id="cache.messenger.restart_workers_signal" />
109+
<tag name="console.command" command="messenger:stop-workers" />
110+
</service>
111+
104112
<service id="console.command.router_debug" class="Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand">
105113
<argument type="service" id="router" />
106114
<tag name="console.command" command="debug:router" />

0 commit comments

Comments
 (0)