Skip to content

Commit c2df1cc

Browse files
committed
Introduce Producer
1 parent f797690 commit c2df1cc

20 files changed

+370
-104
lines changed

bin/mammatus-queue

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ use Mammatus\ContainerFactory;
1515
/**
1616
* Create and run that one cron job
1717
*/
18-
exit((static fn (string $className): int => ContainerFactory::create()->get(App::class)->run($className))($className));
18+
exit((static fn (string $className): int => ContainerFactory::create()->get(App::class)->run($className)->value)($className));
1919
})($argv[1]);

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"ext-json": "^8.2",
99
"composer-plugin-api": "^2.0",
1010
"eventsauce/object-hydrator": "^1.6.1",
11-
"mammatus/app": "dev-master",
11+
"mammatus/app": "dev-introduce-run-tooling",
1212
"mammatus/kubernetes-attributes": "^1",
1313
"mammatus/kubernetes-contracts": "^1",
1414
"mammatus/kubernetes-events": "^1",
1515
"mammatus/life-cycle-events": "^2",
1616
"mammatus/queue-attributes": "dev-main",
17-
"mammatus/queue-contracts": "dev-main",
17+
"mammatus/queue-contracts": "dev-introduce-producer",
1818
"psr/container": "^1.1.2",
1919
"psr/event-dispatcher": "^1.0",
2020
"psr/log": "^2",
@@ -27,6 +27,7 @@
2727
"wyrihaximus/broadcast-contracts": "^1.3",
2828
"wyrihaximus/generative-composer-plugin-tooling": "^1",
2929
"wyrihaximus/monolog-factory": "^2",
30+
"wyrihaximus/psr-3-callable-throwable-logger": "^2.3",
3031
"wyrihaximus/psr-3-context-logger": "^2.0",
3132
"wyrihaximus/simple-twig": "^2.2.1",
3233
"wyrihaximus/ticking-promise": "^3.1"

composer.lock

+92-38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/generated_templates/AbstractList.php.twig

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ namespace Mammatus\Queue\Generated;
66
77
use Mammatus\Queue\Worker;
88
9-
// phpcs:disable
109
/**
1110
* Autogenerated file, do not edit. Changes will be overwritten on the next composer (install|update)
1211
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Mammatus\Queue\Generated;
6+
7+
use Mammatus\Queue\Contracts\Work;
8+
9+
/**
10+
* Autogenerated file, do not edit. Changes will be overwritten on the next composer (install|update)
11+
*/
12+
abstract class WorkQueueMap
13+
{
14+
private const MAP = [
15+
{% for worker in workers %}
16+
\{{ worker.dtoClass }}::class => '{{ worker.consumer.queue }}',
17+
{% endfor %}
18+
];
19+
20+
final protected function lookUp(Work $work): string
21+
{
22+
if (array_key_exists($work::class, self::MAP)) {
23+
return self::MAP[$work::class];
24+
}
25+
26+
throw new \RuntimeException('Unknown work: ' . $work::class);
27+
}
28+
}

0 commit comments

Comments
 (0)