Skip to content

Commit e8b508f

Browse files
author
OleksandrKravchuk
committed
#23540: Queue consumers.
Put poison pill after each 'setup:upgrade' executtion.
1 parent 960a51f commit e8b508f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\MessageQueue\Setup;
9+
10+
use Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface;
11+
use Magento\Framework\Setup\InstallSchemaInterface;
12+
use Magento\Framework\Setup\ModuleContextInterface;
13+
use Magento\Framework\Setup\SchemaSetupInterface;
14+
15+
/**
16+
* Put the poison pill after each potential deployment.
17+
*/
18+
class Recurring implements InstallSchemaInterface
19+
{
20+
/**
21+
* @var PoisonPillPutInterface
22+
*/
23+
private $poisonPillPut;
24+
25+
/**
26+
* @param PoisonPillPutInterface $poisonPillPut
27+
*/
28+
public function __construct(PoisonPillPutInterface $poisonPillPut)
29+
{
30+
$this->poisonPillPut = $poisonPillPut;
31+
}
32+
33+
/**
34+
* Put the Poison Pill after each 'setup:upgrade' command run.
35+
*
36+
* @param SchemaSetupInterface $setup
37+
* @param ModuleContextInterface $context
38+
*
39+
* @throws \Exception
40+
*
41+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
42+
*/
43+
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
44+
{
45+
$this->poisonPillPut->put();
46+
}
47+
}

0 commit comments

Comments
 (0)