diff --git a/src/swoole/Swoole/Async/Client.php b/src/swoole/Swoole/Async/Client.php new file mode 100644 index 0000000..7b5eeee --- /dev/null +++ b/src/swoole/Swoole/Async/Client.php @@ -0,0 +1,83 @@ + $signals An integer or an array of integers representing the signal number(s). + * Before Swoole v6.0.0-rc1, only integer is supported. + * @param float $timeout The timeout value in seconds. Minimum value is 0.001. -1 means no timeout. + * @return bool Returns true on success. Returns false on failure. * @alias Alias of method \Swoole\Coroutine\System::waitSignal(). * @see \Swoole\Coroutine\System::waitSignal() * @since 4.5.0 */ - public static function waitSignal(int $signo, float $timeout = -1): bool + public static function waitSignal(int|array $signals, float $timeout = -1): bool { } diff --git a/src/swoole/Swoole/Coroutine/Http/Server.php b/src/swoole/Swoole/Coroutine/Http/Server.php index 4c89013..778e7f6 100644 --- a/src/swoole/Swoole/Coroutine/Http/Server.php +++ b/src/swoole/Swoole/Coroutine/Http/Server.php @@ -36,7 +36,15 @@ public function set(array $settings): bool { } - public function handle(string $pattern, callable $callback): void + /** + * Register a callback function to handle the HTTP request specified by the URL pattern. + * + * @param string $pattern The URL pattern to match, e.g., "/index". + * @param callable $callback The callback function to handle the HTTP request. + * @return bool Return true on success. Return false on failure. + * Before Swoole v6.0.0-rc1, it returns void. + */ + public function handle(string $pattern, callable $callback): bool { } diff --git a/src/swoole/Swoole/Coroutine/System.php b/src/swoole/Swoole/Coroutine/System.php index 91cfe6b..e75172b 100644 --- a/src/swoole/Swoole/Coroutine/System.php +++ b/src/swoole/Swoole/Coroutine/System.php @@ -102,11 +102,17 @@ public static function waitPid(int $pid, float $timeout = -1): array|false } /** + * Wait for given signal(s) with a timeout. + * + * @param int|array $signals An integer or an array of integers representing the signal number(s). + * Before Swoole v6.0.0-rc1, only integer is supported. + * @param float $timeout The timeout value in seconds. Minimum value is 0.001. -1 means no timeout. + * @return bool Returns true on success. Returns false on failure. * @alias This method has an alias of \Swoole\Coroutine::waitSignal(). * @see \Swoole\Coroutine::waitSignal() * @since 4.5.0 */ - public static function waitSignal(int $signo, float $timeout = -1): bool + public static function waitSignal(int|array $signals, float $timeout = -1): bool { } diff --git a/src/swoole/constants.php b/src/swoole/constants.php index 983620c..fb40467 100644 --- a/src/swoole/constants.php +++ b/src/swoole/constants.php @@ -5,12 +5,12 @@ /* * Swoole version information. */ -define('SWOOLE_VERSION', '6.0.0-dev'); +define('SWOOLE_VERSION', '6.0.0-RC1'); define('SWOOLE_VERSION_ID', 60000); define('SWOOLE_MAJOR_VERSION', 6); define('SWOOLE_MINOR_VERSION', 0); define('SWOOLE_RELEASE_VERSION', 0); -define('SWOOLE_EXTRA_VERSION', 'dev'); +define('SWOOLE_EXTRA_VERSION', ''); /* * If debug logging is enabled or not in Swoole. @@ -304,6 +304,7 @@ #ifdef HAVE_SPINLOCK define('SWOOLE_SPINLOCK', 5); # Supported only if the Spin Locks option is provided in the POSIX thread (pthread) libraries. #endif +define('SWOOLE_COROLOCK', 6); # @since v6.0.0-rc1 /* * Following SIG_* and PRIO_* constants are set only when PHP extension pcntl (to support Process Control) is not @@ -564,6 +565,8 @@ */ define('SOCKET_ECANCELED', 125); +define('TCP_INFO', 11); // @since v6.0.0-rc1 + /* * Constants in this section are used in Swoole servers. */ diff --git a/src/swoole/functions.php b/src/swoole/functions.php index c8b694d..8a6047a 100644 --- a/src/swoole/functions.php +++ b/src/swoole/functions.php @@ -102,7 +102,7 @@ function swoole_test_kernel_coroutine(int $count = 100, float $sleep_time = 1.0) * @alias This function has an alias function swoole_select(). * @see swoole_select() */ -function swoole_client_select(array &$read_array, array &$write_array, array &$error_array, float $timeout = 0.5): int|false +function swoole_client_select(array &$read, array &$write, array &$except, float $timeout = 0.5): int|false { } @@ -110,7 +110,7 @@ function swoole_client_select(array &$read_array, array &$write_array, array &$e * @alias This function is an alias of function swoole_client_select(). * @see swoole_client_select() */ -function swoole_select(array &$read_array, array &$write_array, array &$error_array, float $timeout = 0.5): int|false +function swoole_select(array &$read, array &$write, array &$except, float $timeout = 0.5): int|false { }