改名
This commit is contained in:
+17
-21
@@ -18,13 +18,13 @@ use Kiri\Kiri;
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kafka constructor.
|
* Kafka constructor.
|
||||||
* @param string $topic
|
* @param string $topic
|
||||||
*/
|
*/
|
||||||
public function __construct(public string $topic)
|
public function __construct(public string $topic)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,21 +33,17 @@ use Kiri\Kiri;
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function execute(mixed $class, mixed $method = null): bool
|
public function execute(mixed $class, mixed $method = null): bool
|
||||||
{
|
{
|
||||||
if (!($class instanceof ConsumerInterface)) {
|
if (!in_array(ConsumerInterface::class, class_implements($class))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/** @var KafkaProvider $container */
|
||||||
|
$container = Kiri::getDi()->get(KafkaProvider::class);
|
||||||
|
$container->addConsumer($this->topic, $class);
|
||||||
|
|
||||||
|
return true;
|
||||||
var_dump($class);
|
}
|
||||||
|
|
||||||
/** @var KafkaProvider $container */
|
|
||||||
$container = Kiri::getDi()->get(KafkaProvider::class);
|
|
||||||
$container->addConsumer($this->topic, $class);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user