改名
This commit is contained in:
@@ -11,4 +11,18 @@ namespace Annotation;
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)] class Target extends Attribute
|
||||
{
|
||||
|
||||
|
||||
const WORKER = 'worker';
|
||||
const ALL = 'any';
|
||||
const PROCESS = 'process';
|
||||
const TASK = 'task';
|
||||
|
||||
|
||||
/**
|
||||
* @param string $only
|
||||
*/
|
||||
public function __construct(public string $only = Target::ALL)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Annotation;
|
||||
namespace Kafka\Annotation;
|
||||
|
||||
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use Kafka\ConsumerInterface;
|
||||
use Kafka\KafkaProvider;
|
||||
@@ -38,6 +39,9 @@ use Kiri\Kiri;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var_dump($class);
|
||||
|
||||
/** @var KafkaProvider $container */
|
||||
$container = Kiri::getDi()->get(KafkaProvider::class);
|
||||
$container->addConsumer($this->topic, $class);
|
||||
Reference in New Issue
Block a user