This commit is contained in:
2021-08-05 15:55:27 +08:00
parent a9e172b975
commit 6b9ef31df8
10 changed files with 95 additions and 70 deletions
+1 -15
View File
@@ -27,7 +27,7 @@ class KafkaProvider extends BaseObject
if (isset($this->_topics[$topic])) {
return;
}
$this->_topics[$topic] = $handler;
$this->_topics[$topic] = $handler::class;
}
@@ -40,18 +40,4 @@ class KafkaProvider extends BaseObject
return $this->_topics[$topic] ?? null;
}
/**
* @param $topic
* @param Struct $struct
*/
public function process($topic, Struct $struct)
{
$handler = $this->_topics[$topic] ?? null;
if (empty($handler)) {
return;
}
call_user_func($handler, $struct);
}
}