Login  |  Packages  |  Support  |  Bugs
Top Level :: Event :: swoole :: 4.4.0

swoole 4.4.0

Package Information
Summary Event-driven asynchronous and concurrent networking engine with high performance for PHP.
Maintainers shen zhe < shenzhe163 at gmail dot com > (developer) [details]
Han Tianfeng < mikan dot tenny at gmail dot com > (lead) [details]
QiHao ChenCao < twose at qq dot com > (developer) [details]
License Apache2.0
Description Event-driven asynchronous and concurrent networking engine with high performance for PHP.
- event-driven
- coroutine
- asynchronous non-blocking
- multi-thread reactor
- multi-process worker
- multi-protocol
- millisecond timer
- built-in tcp/http/websocket/http2 server
- coroutine tcp/http/websocket client
- coroutine mysql client
- coroutine redis client
- coroutine read/write file system
- coroutine dns lookup
- support IPv4/IPv6/UnixSocket/TCP/UDP
- support SSL/TLS encrypted transmission
Homepage https://github.com/swoole/swoole-src
Release notes
Version 4.4.0
(stable)
Backward incompatible changes
---

- Consistent with `PHP` official, no longer supports `PHP7.0` (@matyhtf)
- Remove the `Serialize` module, which is maintained in a separate [ext-serialize](https://github.com/swoole/ext-serialize) extension. Reason: Due to frequent changes to the `PHP` kernel, stability cannot be guaranteed
- Remove the `PostgreSQL` module and maintain it in a separate [ext-postgresql](https://github.com/swoole/ext-postgresql) extension. Reason: `PostgreSQL` uses asynchronous ways in the kernel and lacks the necessary unit tests to guarantee quality
- `Runtime::enableCoroutine` is no longer automatically compatible with the internal and external environment of the Coroutine. Once enabled, all blocking operations must be called in the Coroutine (@matyhtf)
* Due to the introduction of the new `Coroutine\MySQL` client driver, the underlying design is more standardized, but there are some small downward incompatible changes
* `Coroutine\MySQL->fetch/nextResult` is optimized for on-demand reads, which will trigger IO scheduling
* When the `defer` attribute is on, the request of `statement` needs to use `statement->recv` to receive the response
* When the `defer/fetch_mode` feature is enabled, if there is unreceived data, a new request will be banned
* Unlike asynchronous, the `connected` attribute is no longer updated based on events in real-time (It's not reliable) but is updated after the `IO` operation fails
- `Coroutine\Http\Client->set_cookie_headers` no longer have key names (#2664) (@twose)

Deprecated content
---

- The `Buffer` module will be discarded. Reason: It is highly replaceable and has low usage. It can be replaced by `PHP` string or `fopen("memory")`
- The `Lock` module will be discarded. Reason for discarding: There may be problems with locking in the Coroutine. You can use `Chan` to implement the Lock of the Coroutine version
- Since async `stream_socket_pair` is introduced, it is recommended to enable the hook by flag `SWOOLE_HOOK_STREAM_FUNCTION` instead of `SWOOLE_HOOK_STREAM_SELECT`

New features
---

+ Added [Library](https://github.com/swoole/swoole-src/tree/master/library), using pure `PHP` to write kernel functions instead of `C/C++`, providing the following features
+ Added high quality `PHP` module `Coroutine\WaitGroup` (@twose)
+ Use the `PHP` code to implement the CURL hook, one-click to make the CURL non-blocking, currently the experimental feature, you need to call `Runtime::enableCoroutine(SWOOLE_HOOK_CURL)` to open (@matyhtf) (@Yurunsoft)
+ Use `PHP` code to implement `exec`/`shell_exec` of Coroutine version (#2657) (@Yurunsof)
+ When `RuntimeHook` is turned on, the function `array_walk`, `array_walk_recursive` will be replaced by the version of Swoole, which will solve the problem that the native function cannot be reentrant, but it will not be able to traverse object (@matyhtf) (@twose)
+ Added a new Coroutine Preemptive Scheduler to prevent the Coroutine from taking too long CPU time to cause other Coroutine to starve. Open the `swoole.enable_preemptive_scheduler = On` by `php.ini`. For details, see [preemptive_scheduler](https://github.com/swoole/swoole-src/tree/master/tests/swoole_coroutine_scheduler/preemptive) (@shiguangqi)
+ Added `Timer::list()` to get `Timer\Iterator`, which can traverse all timers, `Timer\clearAll` clears all timers, `Timer\info(int $id)` gets timer information, ` Timer::stats()` gets the global timer status (#2498) (@twose)
+ Added two methods `getOption` and `setOption` for `Coroutine\Socket` (9d13c29) (@matyhtf)
+ Added `$master_pid` property and `shutdown` method to `Process\Pool` (a1d6eaa) (@matyhtf)
+ Added the 4th parameter of the constructor of `Process\Pool`, when true, the underlying layer will automatically create the Coroutine in the `onWorkerStart` callback (8ceb32cd) (@matyhtf)
+ Support non-blocking `stream_socket_pair` in Runtime hook (#2546) (@matyhtf)
+ Added `static_handler_locations` setting of `Http\Server` to set static file path (@matyhtf)
+ Added `Coroutine\Http\Client->setBasciAuth` method to automatically send `Authorization` header (#2542) (@hongbshi)
+ Added `Coroutine\Http2\Client->ping` method (40041f6) (@shiguangqi)
+ Added `task_use_object` (#2659) (aa01317) (@twose)

Enhancement
---

+ New `Coroutine\MySQL\Client` driver (#2538) (@twose)
+ The underlying programming mode using `C++` and Coroutine (sync writing, async performance)
+ Support SSL connection (configure `['ssl' => true]` when connect)
+ Support request with large data (unlimited)
+ Support response with large data (unlimited)
+ Support `fetch` to read by line (now `fetch` is read on demand, data without fetch does not consume user memory) (#2106)
+ Support `nextResult` read on demand (ibid)
+ Optimized protocol parser
+ `date` related type decimal precision support
+ Error code and information are consistent with `PDO`/`mysqli`
+ `Coroutine\Redis` compatibility mode, enabled by `$redis->set(['compatibility_mode' => true])`, which can make the result of `hmGet/hGetAll/zRange/zRevRange/zRangeByScore/zRevRangeByScore` consistent with phpredis (#2529) (@caohao-php)
+ Now `100K` Coroutine are allowed to exist at the same time by default (c69d320b) (@twose)
+ Support `bailout` (can exit the process correctly when a fatal error occurs in the Coroutine) (#2579) (@twose)
+ `Server` can display a friendly `400/404/503` when error occurred (@matyhtf) (f3f2be9d)
+ `Server` enable `reload_async` and `send_yield` by default (#2555) (9d4a4c47) (@matyhtf)
+ `Server->onFinish` callback is in Coroutine (@twose)
+ `Coroutine\Http\Client` enable `websocket_mask` by default
(c02f4f85) (@twose)
+ Scheduling operation of `Channel` outside the Coroutine is no longer allowed (519b6043) (@twose)
+ `WebSocket\Server` will close the connection when the handshake fails (#2510) (@twose)
+ Under the `Linux`, the dead parent process will automatically send a signal to kill the child process (4b833a3d) (@matyhtf)
+ Memory optimization of `Socket->recv` (642a3552) (@twose)
+ Floating point calculation optimization (#2572) (@tangl163)
+ All built-in classes prohibit cloning/serializing/unseting-declared-properties (f9c974b8) (@twose)
+ `Server->bind` will generate a warning and return false when `uid` is more than `UINT32_MAX`
+ Support `PHP7.4` (#2506) (@twose)

Fixed
---
* Fixed `getProcess` of `Process\Pool` (#2522) (@matyhtf)
* Fixed a bug that exceptions were ignored in some special cases (@twose)
* Fixed memory leak by timer after `fork` process (8f3abee7) (@twose)
* Fixed timezone on non-Linux systems (#2584) (@devnexen)
* Fixed `enable_coroutine=false` + `task_enable_coroutine=true` (#2585) (@matyhtf)
* Fixed Http2's trailer method can not output a empty value header (#2578) (@twose)
* Fixed `Coroutine\Http\Client->setCookies` memory error in special cases (#2644) (@Yurunsoft)
* Fixed #2639 (#2656) (@mabu233)
* Fixed `arginfo_swoole_process_pool_getProcess` (#2658) (@mabu233)
* Fixed `static_handler` does not support soft links (@matyhtf)
* Fixed a bug (I don't know how to describe it) (22504dd4) (@matyhtf)
* Fixed `Server->getClientInfo` error (#2639) (@matyhtf)
* Fixed an illegal operation of the same Socket with multiple Coroutine operations (#2661) (@twose)
* Fixed swoole_table iterator coredump (#2663) (@mabu233)

Coroutine scheduler [?](https://wiki.swoole.com/wiki/page/1487.html)
----
+ Added `Swoole\Coroutine\Scheduler` class as the entry for the `cli` script, replacing `go() + Swoole\Event::wait()`
+ Added `Swoole\Coroutine\Run` function to provide wrapper for `Swoole\Coroutine\Scheduler`
- `go() + Swoole\Event::wait()` may be deprecated

Internal
---
+ Continuous underlying code quality optimization work (@swoole)
+ More unit tests, and use the assertion library [swoole/assert](https://github.com/swoole/assert) based on [webmozart/assert](https://github.com/webmozart/assert) secondary development (@twose)
+ Completely abolish the `Windows` support plan
+ `Coroutine\Http2\Client` refactor (f64874c3) (@matyhtf)
+ The faster callback function caller (@twose)

Experimental content
---
+ May add `Coroutine\Server` and `Coroutine\Http\Server` in `5.0`

[ Latest Tarball ] [ Changelog ] [ View Statistics ]
[ Browse Source ] [ Package Bugs ] [ View Documentation ]

Dependencies for release 4.4.0
PRIVACY POLICY  |  CREDITS
Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jan 27 13:05:01 2019 UTC
Bandwidth and hardware provided by: pair Networks