改名
This commit is contained in:
@@ -63,6 +63,7 @@ class Kafka implements CustomProcess
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param Process $process
|
||||||
* @param array $kafkaServer
|
* @param array $kafkaServer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
|
|||||||
+2
-2
@@ -42,7 +42,7 @@ class Producer extends Component
|
|||||||
* @param array $config
|
* @param array $config
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function __construct($config = [])
|
public function __construct(array $config = [])
|
||||||
{
|
{
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
if (!class_exists(Conf::class)) {
|
if (!class_exists(Conf::class)) {
|
||||||
@@ -57,7 +57,7 @@ class Producer extends Component
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $servers
|
* @param string $servers
|
||||||
* @return Producer
|
* @return Producer
|
||||||
*/
|
*/
|
||||||
public function setBrokers(string $servers): static
|
public function setBrokers(string $servers): static
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class ServerManager extends Abstracts\Server
|
|||||||
if (Snowflake::getPlatform()->isLinux()) {
|
if (Snowflake::getPlatform()->isLinux()) {
|
||||||
$soloProcess->name($system . '.' . $customProcess->getProcessName($soloProcess) . ' start.');
|
$soloProcess->name($system . '.' . $customProcess->getProcessName($soloProcess) . ' start.');
|
||||||
}
|
}
|
||||||
echo sprintf("\033[36m[init]\033[0m Process %s start.", $customProcess->getProcessName($soloProcess)) . PHP_EOL;
|
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Process %s start.", $customProcess->getProcessName($soloProcess)) . PHP_EOL;
|
||||||
$customProcess->onHandler($soloProcess);
|
$customProcess->onHandler($soloProcess);
|
||||||
},
|
},
|
||||||
$redirect_stdin_and_stdout, $pipe_type, $enable_coroutine));
|
$redirect_stdin_and_stdout, $pipe_type, $enable_coroutine));
|
||||||
@@ -213,7 +213,7 @@ class ServerManager extends Abstracts\Server
|
|||||||
*/
|
*/
|
||||||
private function addNewListener(string $type, string $host, int $port, int $mode, array $settings = [])
|
private function addNewListener(string $type, string $host, int $port, int $mode, array $settings = [])
|
||||||
{
|
{
|
||||||
echo sprintf("\033[36m[init]\033[0m $type service %s::%d start.", $host, $port) . PHP_EOL;
|
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m $type service %s::%d start.", $host, $port) . PHP_EOL;
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case Constant::SERVER_TYPE_TCP:
|
case Constant::SERVER_TYPE_TCP:
|
||||||
$this->ports[$port] = TCPServerListener::instance($this->server, $host, $port, $mode, $settings);
|
$this->ports[$port] = TCPServerListener::instance($this->server, $host, $port, $mode, $settings);
|
||||||
@@ -271,7 +271,7 @@ class ServerManager extends Abstracts\Server
|
|||||||
$settings['settings']
|
$settings['settings']
|
||||||
));
|
));
|
||||||
|
|
||||||
echo sprintf("\033[36m[init]\033[0m $type service %s::%d start.", $host, $port) . PHP_EOL;
|
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m $type service %s::%d start.", $host, $port) . PHP_EOL;
|
||||||
|
|
||||||
$this->addDefaultListener($type, $settings);
|
$this->addDefaultListener($type, $settings);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ class ServerWorker extends \Server\Abstracts\Server
|
|||||||
$loader = Snowflake::app()->getRouter();
|
$loader = Snowflake::app()->getRouter();
|
||||||
$loader->_loader();
|
$loader->_loader();
|
||||||
|
|
||||||
echo sprintf("\033[36m[init]\033[0m Worker[%d].%d start.", $server->worker_pid, $workerId) . PHP_EOL;
|
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Worker[%d].%d start.", $server->worker_pid, $workerId) . PHP_EOL;
|
||||||
$this->setProcessName(sprintf('Worker[%d].%d', $workerId, $server->worker_pid));
|
$this->setProcessName(sprintf('Worker[%d].%d', $workerId, $server->worker_pid));
|
||||||
|
|
||||||
$annotation->runtime(CONTROLLER_PATH);
|
$annotation->runtime(CONTROLLER_PATH);
|
||||||
$annotation->runtime(MODEL_PATH);
|
$annotation->runtime(MODEL_PATH);
|
||||||
} else {
|
} else {
|
||||||
echo sprintf("\033[36m[init]\033[0m Tasker[%d].%d start.", $server->worker_pid, $workerId) . PHP_EOL;
|
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Tasker[%d].%d start.", $server->worker_pid, $workerId) . PHP_EOL;
|
||||||
|
|
||||||
$this->setProcessName(sprintf('Tasker[%d].%d', $workerId, $server->worker_pid));
|
$this->setProcessName(sprintf('Tasker[%d].%d', $workerId, $server->worker_pid));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user