This commit is contained in:
as2252258@163.com
2021-05-03 03:48:52 +08:00
parent a90e647529
commit 8137b24865
25 changed files with 273 additions and 306 deletions
+4 -4
View File
@@ -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;
}