modify
This commit is contained in:
@@ -30,17 +30,17 @@ use Snowflake\Snowflake;
|
||||
* @param array $handler
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute(array $handler): mixed
|
||||
public function execute(mixed $class, mixed $method = null): mixed
|
||||
{
|
||||
if (!($handler[0] instanceof ConsumerInterface)) {
|
||||
if (!($class instanceof ConsumerInterface)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var TaskContainer $container */
|
||||
$container = Snowflake::app()->get('kafka-container');
|
||||
$container->addConsumer($this->topic, [$handler[0], 'onHandler']);
|
||||
$container->addConsumer($this->topic, [$class, 'onHandler']);
|
||||
|
||||
return parent::execute($handler); // TODO: Change the autogenerated stub
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user