Swoole
Although in2016
The synergetic feature was supported in, but since the bottom layer is based onsetjmp/longjmp
Realizedstackless
Plan. Therefore, in some scenarios, such ascall_user_func
、array_map
、__destruct
Concorde cannot be used in. Logic in large applications is very complex, and developers are easy to step into pits in teams with many people working together. Use Synergy in Forbidden ScenesAPI
There will be various puzzling problems. The application range of synergetic process is limited.
new edition4.0
Based onboost.context 1.60
The assembly code realizes a brand-new synergetic kernel. SavingPHP
On the basis of the function call stack, theC
Context storage of stack. It has realized the right to allPHP
Grammatical support. Now in anyPHP
Functions of, includingcall_user_func
Reflectance, magic methods,array_map
Concorde can be used in both.
It is now available atPHP
Concorde is used anywhere in the code, developers no longer need to worry about usage scenarios.4.0
Version We andSwooleDistributed
/Swoft
/EasySwoole
The authors of the framework have worked closely together and conducted gray scale trials in a large number of projects. Stability and robustness have reached the industrial level. It can be used in the production environment of large-scale projects.
go(function() {
array_map("test", array("func start\n"));
echo "co end\n";
});
function test($p) {
echo $p;
co::sleep(1);
echo "func end \n";
}
4.0
The branch is usedC++11
Standard, recommendedgcc-4.8
Or later.
Global variable isolation
In the new version, the bottom layer has isolated global variables and can now be usedSwoole\Process
Create multipleSwoole\Server
An example is given.
for ($i = 0; $i < 2; $i++)
{
$p = new swoole_process(function () use ($i) {
$port = 9501 + $i;
$http = new swoole_http_server("127.0.0.1", $port);
$http->on("start", function ($server) use ($port) {
echo "Swoole http server is started at http://127.0.0.1:{$port}\n";
});
$http->on("request", function ($request, $response) {
$response->header("Content-Type", "text/plain");
$response->end("Hello World\n");
});
$http->start();
}, false, false);
$p->start();
}
Other updates
- Repair
http2
The server was unable toChrome
Browser client sent more than16K
Data problems - Repair
BASE
In modeTask
The process cannot be restarted - Increase
Channel->peek
Method for peeking at data - Repair
Server->pause/resume
InSWOOLE_PROCESS
Can’t use under the problem - remove
Linux AIO
, asynchronous files are now implemented using thread pools regardless of settings.IO
- Support
MySQL
Stored procedure
Download 4.0
- GITHUB:https://github.com/swoole/swo …
- Open source China:https://gitee.com/swoole/swoo …
- PECL:https://pecl.php.net/package/ …