8 Commits

Author SHA1 Message Date
as2252258 6926a636b4 eee 2026-06-12 23:57:23 +08:00
as2252258 fe09da4a97 eee 2025-12-31 00:19:31 +08:00
as2252258 cab1ed999a update composer.json.
Signed-off-by: 向林 <as2252258@163.com>
2025-12-23 02:27:26 +00:00
as2252258 349e07b12c eee 2025-12-17 20:51:16 +08:00
as2252258 5fb1f0fc99 eee 2025-07-14 15:36:22 +08:00
as2252258 524d2b8664 eee 2024-09-04 10:14:30 +08:00
as2252258 f4a5a4dbee eee 2024-09-03 15:05:19 +08:00
as2252258 af613784fd eee 2024-09-03 14:47:29 +08:00
4 changed files with 11 additions and 15 deletions
+3
View File
@@ -117,6 +117,9 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa
return $server->send($fd, $this->batchDispatch($data), $reactor_id);
} catch (\Throwable $throwable) {
$response = Json::encode($this->failure(-32700, $throwable->getMessage()));
$this->getLogger()->json_log($throwable);
return $server->send($fd, $response, $reactor_id);
}
}
+5 -12
View File
@@ -3,11 +3,12 @@
namespace Kiri\Rpc;
use Kiri\Di\Context;
use Kiri\Server\Abstracts\BaseProcess;
use Kiri\Server\Processes\AbstractProcess;
use Swoole\Coroutine;
use Swoole\Process;
use function pcntl_signal;
class RpcProcess extends BaseProcess
class RpcProcess extends AbstractProcess
{
@@ -31,17 +32,9 @@ class RpcProcess extends BaseProcess
/**
* @return $this
* @return void
*/
public function onSigterm(): static
public function onSigterm(): void
{
// TODO: Implement onSigterm() method.
if (Context::inCoroutine()) {
Coroutine::create(fn() => $this->onShutdown(Coroutine::waitSignal(SIGTERM | SIGINT)));
} else {
\pcntl_signal(SIGTERM, [$this, 'onStop']);
\pcntl_signal(SIGINT, [$this, 'onStop']);
}
return $this;
}
}
+2 -2
View File
@@ -9,11 +9,11 @@
],
"license": "MIT",
"require": {
"php": ">=8.0",
"php": ">=8.5",
"ext-json": "*",
"ext-msgpack": "*",
"start-point/etcd-php": "^1.1",
"game-worker/kiri-pool": "~v1.0",
"game-worker/kiri-pool": "^v1.0",
"linkorb/etcd-php": "^1.6"
},
"replace": {
+1 -1
View File
@@ -50,7 +50,7 @@ return [
"check" => [
"node" => "t2.320",
"checkId" => "service:redis1",
"name" => "Redis health check",
"name" => "NoSql health check",
"Annotations" => "Script based health check",
"status" => "passing",
"serviceID" => "redis1",