With the Spring Festival of the Year of the Ox just around the corner, Swoole is celebrating its last edition of 2020.
Thank you to all of you who contribute to Swoole’s code, documentation, and ecology, and we look forward to more
I wish you all a happy Spring Festival in the year of the Ox in 2021.
V4.6.3 is primarily a Bug fix with no downward incompatible changes.
- A new
Swoole\Coroutine\go
和Swoole\Coroutine\defer
Function, which prevents the user from manually turning off the short name to copy and paste an error when running the sample code
use function Swoole\Coroutine\go;
use function Swoole\Coroutine\run;
use function Swoole\Coroutine\defer;
run(function () {
defer(function () {
echo "co1 end\n";
});
sleep(1);
go(function () {
usleep(100000);
defer(function () {
echo "co2 end\n";
});
echo "co2\n";
});
echo "co1\n";
});
Copy the code
- This version also allows users to set their own HTTP headers for Content-Length if they know the Length. The content-Length set by the user overwrites the content-length of the underlying calculation
use Swoole\Http\Server;
use Swoole\Http\Request;
use Swoole\Http\Response;
$http = new Server('0.0.0.0'.9501);
$http->on('Request'.function (Request $request, Response $response) {
$msg = 'Hello, Swoole';
$response->header('Content-Length', strlen($msg));
$response->end($msg);
});
$http->start();
Copy the code
Update log
Here’s the full update log:
The new API
- Added Swoole\Coroutine\go function (Swoole /library@82f63be) (@matyhtf)
- Added the Swoole\Coroutine\defer function (Swoole /library@92fd0de) (@matyhtf)
To enhance
- Add compression_min_length (#4033) to HTTP server (@matyhtf)
- Content-length HTTP header (#4041) allowed at the application layer (@doubaokun)
repair
- Fix coredump (swoole/swoole-src@709813f) when file opening limit is reached (@matyhtf)
- Fix JIT disabled (#4029) (@twose)
- repair
Response::create()
Parameter error problem (swoole/swoole-src@a630b5b) (@matyhtf) - Fixed task_worker_id error (#4040) (@doubaokun)
- 修复 了 PHP8 native curl hook enabled coredump (#4042)(#4045) (@yurunsoft)(@matyhtf)
- Fixed memory out-of-bounds error in shutdown phase when fatal Error occurred (#4050)
The kernel
- Optimized SSL_connect/SSL_shutdown (#4030) (@matyhtf)
- Exit process directly with fatal error (#4053) (@matyhtf)
Welcome to Swoole’s official account to get new information as soon as possible.