This commit is contained in:
2026-04-04 10:41:53 +08:00
parent 9e1e16dca9
commit e819fe9ba4
6 changed files with 22 additions and 12 deletions
+3 -2
View File
@@ -13,10 +13,11 @@ interface OnCloseInterface
/**
* @param Server $server
* @param int $fd
* @param int $fd
* @param int $reactorId
* @return void
*/
public function onClose(Server $server, int $fd): void;
public function onClose(Server $server, int $fd, int $reactorId): void;
}
+3 -2
View File
@@ -10,9 +10,10 @@ interface OnConnectInterface
/**
* @param Server $server
* @param int $fd
* @param int $fd
* @param int $reactorId
* @return void
*/
public function onConnect(Server $server, int $fd): void;
public function onConnect(Server $server, int $fd, int $reactorId): void;
}
+4 -2
View File
@@ -2,15 +2,17 @@
namespace Kiri\Server\Contract;
use Swoole\{WebSocket\Server};
interface OnDisconnectInterface
{
/**
* @param int $fd
* @param Server $server
* @param int $fd
* @return void
*/
public function onDisconnect(int $fd): void;
public function onDisconnect(Server $server, int $fd): void;
}
+4 -3
View File
@@ -2,7 +2,7 @@
namespace Kiri\Server\Contract;
use Swoole\Server;
use Swoole\WebSocket\Server;
use Swoole\WebSocket\Frame;
interface OnMessageInterface
@@ -10,9 +10,10 @@ interface OnMessageInterface
/**
* @param Frame $frame
* @param Server $server
* @param Frame $frame
* @return void
*/
public function onMessage(Frame $frame): void;
public function onMessage(Server $server, Frame $frame): void;
}
+1 -1
View File
@@ -3,7 +3,7 @@
namespace Kiri\Server\Contract;
use Swoole\Http\Request;
use Swoole\Http\Server;
use Swoole\WebSocket\Server;
interface OnOpenInterface
{
+7 -2
View File
@@ -4,6 +4,8 @@
namespace Kiri\Server\Contract;
use Swoole\Server;
/**
* Interface OnPipeMessageInterface
* @package Server\Contract
@@ -12,9 +14,12 @@ interface OnPipeMessageInterface
{
/**
*
* @param Server $server
* @param int $src_worker_id
* @param mixed $message
* @return void
*/
public function process(): void;
public function onPipeMessage(Server $server, int $src_worker_id, mixed $message): void;