改名
This commit is contained in:
@@ -22,17 +22,16 @@ class OnPipeMessage extends Callback
|
|||||||
/**
|
/**
|
||||||
* @param Server $server
|
* @param Server $server
|
||||||
* @param int $src_worker_id
|
* @param int $src_worker_id
|
||||||
* @param $message
|
* @param $swollen_universalize
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function onHandler(Server $server, int $src_worker_id, $message)
|
public function onHandler(Server $server, int $src_worker_id, $swollen_universalize)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$swollen_universalize = swoole_unserialize($message);
|
|
||||||
match ($swollen_universalize['action'] ?? null) {
|
match ($swollen_universalize['action'] ?? null) {
|
||||||
'kafka' => $this->onKafkaWorker($swollen_universalize),
|
'kafka' => $this->onKafkaWorker($swollen_universalize),
|
||||||
'crontab' => $this->onCrontabWorker($swollen_universalize),
|
'crontab' => $this->onCrontabWorker($swollen_universalize),
|
||||||
default => $this->onMessageWorker($server, $src_worker_id, $message)
|
default => $this->onMessageWorker($server, $src_worker_id, $swollen_universalize)
|
||||||
};
|
};
|
||||||
} catch (\Throwable $exception) {
|
} catch (\Throwable $exception) {
|
||||||
$this->addError($exception);
|
$this->addError($exception);
|
||||||
|
|||||||
@@ -65,10 +65,9 @@ class Zookeeper extends Process
|
|||||||
*/
|
*/
|
||||||
private function dispatch($server, Redis|\Redis $redis, int $setting, $value)
|
private function dispatch($server, Redis|\Redis $redis, int $setting, $value)
|
||||||
{
|
{
|
||||||
$server->sendMessage(swoole_serialize([
|
$server->sendMessage([
|
||||||
'action' => 'crontab', 'handler' => swoole_unserialize($redis->get('crontab:' . $value))
|
'action' => 'crontab', 'handler' => swoole_unserialize($redis->get('crontab:' . $value))
|
||||||
]), random_int(0, $setting - 1));
|
], random_int(0, $setting - 1));
|
||||||
$redis->del('crontab:' . $value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user