eee
This commit is contained in:
@@ -20,15 +20,30 @@ abstract class BaseProcess implements OnProcessInterface
|
|||||||
private bool $stop = false;
|
private bool $stop = false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
protected bool $redirect_stdin_and_stdout = FALSE;
|
protected bool $redirect_stdin_and_stdout = FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
protected int $pipe_type = SOCK_DGRAM;
|
protected int $pipe_type = SOCK_DGRAM;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
protected bool $enable_coroutine = false;
|
protected bool $enable_coroutine = false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected bool $enable_queue = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StdoutLogger
|
* @var StdoutLogger
|
||||||
*/
|
*/
|
||||||
@@ -43,9 +58,21 @@ abstract class BaseProcess implements OnProcessInterface
|
|||||||
public \Kiri\Di\Container $container;
|
public \Kiri\Di\Container $container;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
public string $name = '';
|
public string $name = '';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isEnableQueue(): bool
|
||||||
|
{
|
||||||
|
return $this->enable_queue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -45,7 +45,11 @@ trait TraitServer
|
|||||||
if (isset($this->_process[$name->getName()])) {
|
if (isset($this->_process[$name->getName()])) {
|
||||||
throw new Exception('Process(' . $name->getName() . ') is exists.');
|
throw new Exception('Process(' . $name->getName() . ') is exists.');
|
||||||
}
|
}
|
||||||
$this->_process[$name->getName()] = $this->genProcess($name);
|
$process = $this->genProcess($name);
|
||||||
|
if ($name->isEnableQueue()) {
|
||||||
|
$process->useQueue();
|
||||||
|
}
|
||||||
|
$this->_process[$name->getName()] = $process;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,10 +196,10 @@ trait TraitServer
|
|||||||
{
|
{
|
||||||
return match ($type) {
|
return match ($type) {
|
||||||
Constant::SERVER_TYPE_BASE, Constant::SERVER_TYPE_TCP,
|
Constant::SERVER_TYPE_BASE, Constant::SERVER_TYPE_TCP,
|
||||||
Constant::SERVER_TYPE_UDP => Server::class,
|
Constant::SERVER_TYPE_UDP => Server::class,
|
||||||
Constant::SERVER_TYPE_HTTP => HServer::class,
|
Constant::SERVER_TYPE_HTTP => HServer::class,
|
||||||
Constant::SERVER_TYPE_WEBSOCKET => WServer::class,
|
Constant::SERVER_TYPE_WEBSOCKET => WServer::class,
|
||||||
default => null
|
default => null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user