改名
This commit is contained in:
@@ -37,8 +37,8 @@ class Http extends Server
|
|||||||
*/
|
*/
|
||||||
public function __construct($application, $host, $port = null, $mode = null, $sock_type = null)
|
public function __construct($application, $host, $port = null, $mode = null, $sock_type = null)
|
||||||
{
|
{
|
||||||
parent::__construct($host, $port, $mode, $sock_type);
|
|
||||||
$this->application = $application;
|
$this->application = $application;
|
||||||
|
parent::__construct($host, $port, $mode, $sock_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -55,7 +55,6 @@ class Http extends Server
|
|||||||
public function set(array $settings, $pool = null, $events = [], $config = [])
|
public function set(array $settings, $pool = null, $events = [], $config = [])
|
||||||
{
|
{
|
||||||
parent::set($settings);
|
parent::set($settings);
|
||||||
Snowflake::get()->set(Pool::class, $pool);
|
|
||||||
ServerManager::set($this, $settings, $this->application, $events, $config);
|
ServerManager::set($this, $settings, $this->application, $events, $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ abstract class Service extends Server
|
|||||||
*/
|
*/
|
||||||
public function __construct($application, $host, $port = null, $mode = null, $sock_type = null)
|
public function __construct($application, $host, $port = null, $mode = null, $sock_type = null)
|
||||||
{
|
{
|
||||||
parent::__construct($host, $port, $mode, $sock_type);
|
|
||||||
$this->application = $application;
|
$this->application = $application;
|
||||||
|
parent::__construct($host, $port, $mode, $sock_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,6 @@ abstract class Service extends Server
|
|||||||
public function set(array $settings, $pool = null, $events = [], $config = [])
|
public function set(array $settings, $pool = null, $events = [], $config = [])
|
||||||
{
|
{
|
||||||
parent::set($settings);
|
parent::set($settings);
|
||||||
Snowflake::get()->set(Pool::class, $pool);
|
|
||||||
ServerManager::set($this, $settings, $this->application, $events, $config);
|
ServerManager::set($this, $settings, $this->application, $events, $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ class WebSocket extends Server
|
|||||||
*/
|
*/
|
||||||
public function __construct($application, $host, $port = null, $mode = null, $sock_type = null)
|
public function __construct($application, $host, $port = null, $mode = null, $sock_type = null)
|
||||||
{
|
{
|
||||||
parent::__construct($host, $port, $mode, $sock_type);
|
|
||||||
$this->application = $application;
|
$this->application = $application;
|
||||||
|
parent::__construct($host, $port, $mode, $sock_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +69,6 @@ class WebSocket extends Server
|
|||||||
|
|
||||||
$application = Snowflake::get();
|
$application = Snowflake::get();
|
||||||
$application->set(WebSocket::class, $this);
|
$application->set(WebSocket::class, $this);
|
||||||
$application->set(Pool::class, $pool);
|
|
||||||
|
|
||||||
ServerManager::set($this, $settings, $application, $events, $config);
|
ServerManager::set($this, $settings, $application, $events, $config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class ServerManager
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$application = Snowflake::get();
|
$application = Snowflake::get();
|
||||||
|
$application->set(Pool::class, $pool);
|
||||||
if (is_string($process) && class_exists($process)) {
|
if (is_string($process) && class_exists($process)) {
|
||||||
return static::createProcess($process, $application, $pool, $workerId);
|
return static::createProcess($process, $application, $pool, $workerId);
|
||||||
}
|
}
|
||||||
@@ -69,7 +70,6 @@ class ServerManager
|
|||||||
*/
|
*/
|
||||||
protected static function createProcess($process, $application, $pool, $workerId)
|
protected static function createProcess($process, $application, $pool, $workerId)
|
||||||
{
|
{
|
||||||
$application->set(Pool::class, $pool);
|
|
||||||
$process = new $process($application);
|
$process = new $process($application);
|
||||||
$application->debug(sprintf('Worker #%d is running.', $workerId));
|
$application->debug(sprintf('Worker #%d is running.', $workerId));
|
||||||
return $process->start();
|
return $process->start();
|
||||||
|
|||||||
Reference in New Issue
Block a user