Swoole 4.4 official version has been released, containing a large number of updates

 Swoole 4.4 official version has been released, this version includes a large number of updates, details are as follows:

Down incompatible changes

  • And PHPofficial consistent, no longer supported PHP7.0 (@matyhtf)
  • Remove the Serializemodule, in a separate  ext-serialize  maintenance extension abandoned reason: Because PHPthe kernel change frequently, making it impossible to achieve a stable available modules, and php serializecompared to no significant differences in localization
  • Remove the PostgreSQLmodule, in a separate  ext-postgresql  maintenance extension abandoned reason:  PostgreSQLthe use of asynchronous callbacks way to achieve coroutine scheduler, the kernel does not comply with the current unified planning of coroutines. In addition PostgreSQLthe current user is very low, and the lack of necessary unit testing to ensure quality
  • Runtime::enableCoroutineNo longer automatically compatible coroutine internal and external environment, once opened, all the blocking operation must call (@matyhtf) in Coroutine
  • Since the introduction of a new coroutine MySQLclient-driven, low-level design more standardized, but there are some small downward incompatible change

    • fetch/nextResultOptimized for read on demand, will produce IO scheduling
    • Start defertime characteristics,  statementthe request issued, it is necessary to use statement->recvthe reception
    • Start defer/fetch_modetime characteristic, if the received data is not completed, will not initiate a new request
    • Unlike asynchronous,  connectedproperty will no longer be updated in real time based on the event, but IOafter the update operation fails

Deprecation warnings

  • The waste Buffermodule discarding reasons: substitutability strong, low utilization rate, available PHPstring, fopen("memory")in place.
  • The waste Lockmodule discarding reasons: there may be a problem in the coroutine mode locking, may be used chanto achieve lock release coroutine
  • Since the introduction of stream_socket_pairco-phased, it is recommended when the hook is turned on, if a separate configuration requirements, use the SWOOLE_HOOK_STREAM_FUNCTIONconstant instead ofSWOOLE_HOOK_STREAM_SELECT

New features

  • New Library, pure PHPwrite a kernel function instead C/C++, it offers the following features

    • New high quality PHPmodules Coroutine\WaitGroup (@twose)
    • Using the PHPcode to achieve the CURL Hook, a key to CURL coroutine of the current experimental characteristics, require special call Runtime::enableCoroutine(SWOOLE_HOOK_CURL)to open (@matyhtf) (@Yurunsoft)
    • Using the PHPcode to achieve exec/ shell_execcoroutine of (# 2657) (@Yurunsoft)
    • Open RuntimeHook, it will replace the function array_walkarray_walk_recursiveversion swoole implemented to address the primary function non-reentrant problem, but the cause could not traverse the object (@matyhtf) (@twose)
  • Add coroutine preemptive scheduling, a coroutine prevents CPU time is too long cause other coroutine starvation, by php.iniconfiguration swoole.enable_preemptive_scheduler = On open, see relevant examples preemptive_scheduler  (@shiguangqi)
  • New Timer::list()return Timer\Iterator, can traverse all timer,  Timer\clearAllclear all timers,  Timer\info(int $id)get timer information,  Timer::stats()obtain the global timer status (# 2498) (@twose)
  • Add  Co\Sockettwo methods getOption and  setOption (9d13c29) (@matyhtf)
  • Add  Process\Poolthe $master_pid properties and  shutdownmethods (a1d6eaa) (@matyhtf)
  • New Process\Poolfourth parameter configuration method, the underlayer is true automatically onWorkerStartcallback open coroutine (8ceb32cd) (@matyhtf)
  • New stream_socket_pairco-phased support (# 2546) (@matyhtf)
  • Add Http\Serverthe static_handler_locationssettings, you can set a static file path (@matyhtf)
  • New Co\Http\Client->setBasciAuthmethod for automatically transmitting Authorizationhead (# 2542) (@hongbshi)
  • New  Co\Http2\Client->pingmethod (40041f6) (@shiguangqi)
  • New hook_flagsconfiguration items used to replace the Runtime::enableCoroutine()function call

Increase

  • The new coroutine MySQLclient-driven, bottom round co-phased (# 2538) (@twose)

    • Use bottom C++and coroutine program mode (synchronous blocking writing, asynchronous performance)
    • It supports SSL connections (when disposed connect  ['ssl' => true]to, certificates and other configurations not supported)
    • Large data transmission support (no upper limit, automatic spell package bottom, the upper limit is the upper limit MySQL server configuration)
    • Support large data reception
    • Support fetchby line reading (now fetchto read on demand, did not fetch the data will not consume user memory) ( # 2106 )
    • Support nextResultread-demand (ibid)
    • The client close, the client holds statementsautomatically become unavailable, avoid border problems
    • (When the protocol analysis) optimized away some unnecessary memory copy
    • dateRelated types support decimal precision
    • Error codes and information PDO/ mysqliconsistent
  • Co\RedisCompatibility mode, the $redis->set(['compatibility_mode' => true])opening may be such that hmGet/hGetAll/zRange/zRevRange/zRangeByScore/zRevRangeByScorethe like returns, and phpredisconsistent (# 2529) (@ caohao- php)
  • The default allows 100Ka coroutine exist (c69d320b) (@twose)
  • Support bailoutmechanisms (processes can quit properly when a fatal error occurs in the coroutines) (# 2579) (@twose)
  • ServerWill show a friendly under the circumstances when an error occurs 400/404/503interface rather than no output (@matyhtf) (f3f2be9d)
  • ServerAsynchronous restart feature is enabled by default security and automatic scheduling feature coroutine large data transmitted (# 2555) (9d4a4c47) (@matyhtf)
  • ServerThe onFinishcallback support auto-negotiation process environment (@twose)
  • HttpThe client is enabled by default websocket_mask, will no longer appear inexplicable Rom websocketproblem (c02f4f85) (@twose)
  • No longer allowed in the outsourcing process Channelscheduling operation (519b6043) (@twose)
  • WebSocketHandshake disconnect (# 2510) (@twose) failure
  • In Linuxthe underlying case will automatically send a signal when the parent process to kill the child process exits abnormally (4b833a3d) (@matyhtf)
  • When the Socket->recvrecovery end unwanted insufficient data length memory (642a3552) (@twose)
  • Floating-point calculation error optimization (# 2572) (@ tangl163)
  • All built-in classes are prohibited cloning / disable serialization / delete prohibit attribute defines the bottom (f9c974b8) (@twose)
  • Server->bindIn uidmore than UINT32_MAXwhen a warning is generated and returned
  • Compatible PHP7.4 (# 2506) (@twose)

repair

  • Fix Process\Poolthe getProcessproblem (# 2522) (@matyhtf)
  • Fix the problem in some special cases the exception is ignored (VM caught in a cycle of events and no chance of abnormalities) (@twose)
  • In the process of restoration timer forkmemory leak (8f3abee7) (@twose) produced after
  • The problem timezone repair non-Linux systems to compile (# 2584) (@devnexen)
  • Repair enable_coroutineand task_enable_coroutineopening and closing of a problem (# 2585) (@matyhtf)
  • Http2 repair method does not output the trailer is empty head (# 2578) (@twose)
  • Fix Co\Http\Client->setCookiesmemory errors (# 2644) (@Yurunsoft) in exceptional circumstances
  • Repair # 2639 (# 2656) (@ mabu233)
  • Repair arginfo_swoole_process_pool_getProcess (# 2658) (@ mabu233)
  • Repair static_handlerdoes not support soft link (@matyhtf)
  • Repair OSXUnder stuck (22504dd4) (@matyhtf)
  • Fix to enable SSLthe taskprocess to use Server->getClientInfoan error (# 2639) (@matyhtf)
  • Repair multi coroutine operations illegal operation of BUG same Socket (# 2661) (@twose)

Coroutine scheduler ?

  • New Swoole\Coroutine\Schedulerscheduler class as the clientry of the command-line scripts, substituted go() + Swoole\Event::wait()way
  • Increasing Swoole\Coroutine\Runfunction, to provide Swoole\Coroutine\Schedulera package
  • go() + Swoole\Event::wait()The operating mode may be abolished

Kernel

  • Continued underlying code quality optimization (@swoole)
  • More unit tests, and use based  webmozart / assert  assertion library secondary development from the  swoole / the Assert  (@twose)
  • Completion memory allocation failure detection (b19bebac) (5a1ddad3) (@matyhtf)
  • The complete abolition of Windowssupport programs
  • Some functions will be divided into coroutine finishing Systemor Schedulermodule, repeal util module
  • Co\Http2\ClientThe bottom of the coroutine (f64874c3) (@matyhtf)
  • The underlying function fully cached information developers registered, the callback is invoked when faster (@twose)

Experimental content

  • Possible in 5.0new Co\ServerandCo\Http\Server
  • CURL Hook(Not supported curl_multi)

Guess you like

Origin www.oschina.net/news/108129/swoole-4-4-released