This commit is contained in:
2021-07-19 19:04:13 +08:00
parent 5aa94c1a25
commit b369e5c492
21 changed files with 952 additions and 616 deletions
+3 -2
View File
@@ -4,6 +4,7 @@
namespace Rpc;
use Exception;
use HttpServer\Route\Router;
use Snowflake\Snowflake;
@@ -22,7 +23,7 @@ class Actuator
/**
* Actuator constructor.
* @param int $port
* @throws \Exception
* @throws Exception
*/
public function __construct(public int $port)
{
@@ -33,7 +34,7 @@ class Actuator
/**
* @param string $path
* @param string|callable $callback
* @throws \Exception
* @throws Exception
*/
public function addListener(string $path, string|callable $callback): void
{
+6 -4
View File
@@ -77,10 +77,12 @@ class Service extends Component
}
/**
* @param $mode
* @throws Exception
*/
/**
* @param $rpcServer
* @param $config
* @param $mode
* @throws Exception
*/
private function addCallback($rpcServer, $config, $mode)
{
$tcp = [SWOOLE_SOCK_TCP, SWOOLE_TCP, SWOOLE_TCP6, SWOOLE_SOCK_TCP6];