This commit is contained in:
2020-08-31 01:39:28 +08:00
parent c044b8714e
commit aae29752d2
3 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "framework/snowflake",
"name": "game-worker/snowflake",
"description": "test framework",
"authors": [
{
+7 -2
View File
@@ -4,6 +4,7 @@ defined('APP_PATH') or define('APP_PATH', __DIR__ . '/../../');
use HttpServer\Http\Response;
use Snowflake\Snowflake;
use HttpServer\Http\Context;
if (!function_exists('make')) {
@@ -90,8 +91,12 @@ if (!function_exists('alias')) {
}
if (!function_exists('name')) {
/**
* @param string $name
*/
function name($name)
{
swoole_set_process_name($name);
@@ -107,10 +112,10 @@ if (!function_exists('response')) {
*/
function response()
{
if (!Snowflake::has('response')) {
if (!Context::hasContext('response')) {
return make('response', Response::class);
}
return Snowflake::get()->response;
return Context::getContext('response');
}
}
+4
View File
@@ -11,6 +11,7 @@ use Swoole\WebSocket\Frame;
return [
'servers' => [
[
'id' => '',
'type' => Server::HTTP,
'host' => '127.0.0.1',
'port' => 9527,
@@ -26,6 +27,7 @@ return [
]
],
[
'id' => '',
'type' => Server::PACKAGE,
'host' => '127.0.0.1',
'port' => 9628,
@@ -45,6 +47,7 @@ return [
]
],
[
'id' => '',
'type' => Server::TCP,
'host' => '127.0.0.1',
'port' => 9629,
@@ -68,6 +71,7 @@ return [
]
],
[
'id' => '',
'type' => Server::WEBSOCKET,
'host' => '127.0.0.1',
'port' => 9530,