Skip to content

Commit 8617d96

Browse files
committed
Add three helper abstract Rules matching the control messages for Scheduler start, shutdown and heartbeat
1 parent a294d6a commit 8617d96

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

src/Rule/OnHeartbeat.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php declare(strict_types=1);
2+
3+
/*
4+
* This file is part of the PHP Event Correlation package.
5+
*
6+
* (c) James Lucas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace EdgeTelemetrics\EventCorrelation\Rule;
13+
14+
use EdgeTelemetrics\EventCorrelation\Scheduler;
15+
16+
/**
17+
* Class OnStartup
18+
* @package EdgeTelemetrics\EventCorrelation\Rule
19+
*/
20+
abstract class OnHeartbeat extends MatchSingle
21+
{
22+
const EVENTS = [[Scheduler::CONTROL_MSG_HEARTBEAT]];
23+
}

src/Rule/OnShutdown.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php declare(strict_types=1);
2+
3+
/*
4+
* This file is part of the PHP Event Correlation package.
5+
*
6+
* (c) James Lucas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace EdgeTelemetrics\EventCorrelation\Rule;
13+
14+
/**
15+
* Class OnShutdown
16+
* @package EdgeTelemetrics\EventCorrelation\Rule
17+
*/
18+
abstract class OnShutdown extends Cron
19+
{
20+
const CRON_SCHEDULE = self::ON_SHUTDOWN;
21+
}

src/Rule/OnStartup.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php declare(strict_types=1);
2+
3+
/*
4+
* This file is part of the PHP Event Correlation package.
5+
*
6+
* (c) James Lucas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace EdgeTelemetrics\EventCorrelation\Rule;
13+
14+
/**
15+
* Class OnStartup
16+
* @package EdgeTelemetrics\EventCorrelation\Rule
17+
*/
18+
abstract class OnStartup extends Cron
19+
{
20+
const CRON_SCHEDULE = self::ON_INITIALISATION;
21+
}

0 commit comments

Comments
 (0)