eee
This commit is contained in:
@@ -77,7 +77,7 @@ class OnServerWorker extends Kiri\Server\Abstracts\Server
|
|||||||
*/
|
*/
|
||||||
protected function processName(Server $server, string $prefix): void
|
protected function processName(Server $server, string $prefix): void
|
||||||
{
|
{
|
||||||
Kiri::setProcessName(sprintf($prefix . ' AbstractProcess[%d].%d', $server->worker_pid, $server->worker_id));
|
Kiri::setProcessName(sprintf($prefix . ' Process[%d].%d', $server->worker_pid, $server->worker_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,21 +22,13 @@ trait TraitProcess
|
|||||||
*/
|
*/
|
||||||
public function addProcess(string|array|AbstractProcess $class): void
|
public function addProcess(string|array|AbstractProcess $class): void
|
||||||
{
|
{
|
||||||
if (!is_array($class)) {
|
if (!is_array($class)) $class = [$class];
|
||||||
$class = [$class];
|
|
||||||
}
|
|
||||||
foreach ($class as $name) {
|
foreach ($class as $name) {
|
||||||
if (is_string($name)) {
|
if (is_string($name)) $name = Kiri::getDi()->get($name);
|
||||||
$name = Kiri::getDi()->get($name);
|
|
||||||
}
|
|
||||||
if (isset($this->_process[$name->getName()])) {
|
if (isset($this->_process[$name->getName()])) {
|
||||||
throw new Exception('AbstractProcess(' . $name->getName() . ') is exists.');
|
throw new Exception('AbstractProcess(' . $name->getName() . ') is exists.');
|
||||||
}
|
}
|
||||||
$process = $this->genProcess($name);
|
$this->_process[$name->getName()] = $this->genProcess($name);
|
||||||
if ($name->isEnableQueue()) {
|
|
||||||
$process->useQueue();
|
|
||||||
}
|
|
||||||
$this->_process[$name->getName()] = $process;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user