Skip to content

Commit 3929aca

Browse files
committed
refactor subscription engine
1 parent 466f278 commit 3929aca

36 files changed

Lines changed: 2332 additions & 4 deletions

docker-compose.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1+
# docker run --rm -it --volume $PWD:/app --net="host" -w /app ghcr.io/patchlevel/php:8.5
12
services:
3+
php:
4+
image: ghcr.io/patchlevel/php:8.5
5+
volumes:
6+
- .:/app
7+
working_dir: /app
8+
network_mode: host
9+
tty: true
10+
stdin_open: true
11+
command: sleep infinity
12+
213
postgres:
314
image: postgres:alpine
415
environment:
@@ -13,4 +24,4 @@ services:
1324
- MYSQL_ALLOW_EMPTY_PASSWORD="yes"
1425
- MYSQL_DATABASE=eventstore
1526
ports:
16-
- 3306:3306
27+
- 3306:3306
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Boot extends Command
8+
{
9+
/**
10+
* @param list<string>|null $ids
11+
* @param list<string>|null $groups
12+
* @param positive-int|null $limit
13+
*/
14+
public function __construct(
15+
array|null $ids = null,
16+
array|null $groups = null,
17+
public readonly int|null $limit = null,
18+
) {
19+
parent::__construct($ids, $groups);
20+
}
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
abstract class Command
8+
{
9+
/**
10+
* @param list<string>|null $ids
11+
* @param list<string>|null $groups
12+
*/
13+
public function __construct(
14+
public readonly array|null $ids = null,
15+
public readonly array|null $groups = null,
16+
) {
17+
}
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Pause extends Command
8+
{
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Reactivate extends Command
8+
{
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Refresh extends Command
8+
{
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Remove extends Command
8+
{
9+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Run extends Command
8+
{
9+
/**
10+
* @param list<string>|null $ids
11+
* @param list<string>|null $groups
12+
* @param positive-int|null $limit
13+
*/
14+
public function __construct(
15+
array|null $ids = null,
16+
array|null $groups = null,
17+
public readonly int|null $limit = null,
18+
) {
19+
parent::__construct($ids, $groups);
20+
}
21+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Setup extends Command
8+
{
9+
/**
10+
* @param list<string>|null $ids
11+
* @param list<string>|null $groups
12+
*/
13+
public function __construct(
14+
array|null $ids = null,
15+
array|null $groups = null,
16+
public readonly bool $skipBooting = false,
17+
) {
18+
parent::__construct($ids, $groups);
19+
}
20+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Patchlevel\EventSourcing\Subscription\Engine\Command;
6+
7+
final class Teardown extends Command
8+
{
9+
}

0 commit comments

Comments
 (0)