改名
This commit is contained in:
@@ -270,7 +270,6 @@ class ServerManager
|
||||
* @param int $port
|
||||
* @param int $mode
|
||||
* @param array $settings
|
||||
* @throws NotFindClassException
|
||||
* @throws ReflectionException
|
||||
* @throws ConfigException
|
||||
*/
|
||||
@@ -300,7 +299,7 @@ class ServerManager
|
||||
return;
|
||||
}
|
||||
while ($this->checkPortIsAlready($port)) {
|
||||
Process::kill($pid,SIGTERM);
|
||||
Process::kill($pid, SIGTERM);
|
||||
usleep(300);
|
||||
}
|
||||
}
|
||||
@@ -329,7 +328,6 @@ class ServerManager
|
||||
/**
|
||||
* @param string $type
|
||||
* @param array $settings
|
||||
* @throws NotFindClassException
|
||||
* @throws ReflectionException
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -339,13 +337,14 @@ class ServerManager
|
||||
$this->addTaskListener($settings['events']);
|
||||
}
|
||||
$this->addServiceEvents($settings['events'] ?? [], $this->server);
|
||||
Kiri::getDi()->setBindings(SwooleServerInterface::class,
|
||||
$this->server);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $events
|
||||
* @param Server|Port $server
|
||||
* @throws NotFindClassException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function addServiceEvents(array $events, Server|Port $server)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Server;
|
||||
|
||||
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
* @mixin Server
|
||||
*/
|
||||
interface SwooleServerInterface
|
||||
{
|
||||
|
||||
}
|
||||
@@ -201,10 +201,6 @@ class Container extends BaseObject implements ContainerInterface
|
||||
foreach ($this->getPropertyNote($reflect) as $property => $inject) {
|
||||
/** @var Inject $inject */
|
||||
$inject->execute($object, $property);
|
||||
|
||||
if ($object::class == Server::class){
|
||||
var_dump($object, $property);
|
||||
}
|
||||
}
|
||||
return $object;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user