Why cannot php be asynchronous like node?

Source: Internet
Author: User
Php is already in the 5.6 era, and the official team still hasn't made concessions on threads and Asynchronization... the era of Universal API .... A lot of things are not simply web pages. php is already in the 5.6 era. The official website still hasn't made concessions on threads and Asynchronization... the era of Universal API .... many things are no longer simply web pages.

Reply content:

Php has already been in the 5.6 era, and the official team has not yet made concessions on threads and Asynchronization... all of them are in the API era... a lot of things are no longer simply web pages.

PHP has many asynchronous methods, such
1. asynchronous request receiving http://php.net/manual/en/function.stream-select.php through IO multiplexing
2. Use php multi-process http://php.net/manual/en/book.pcntl.php
3. Use php multi-threaded http://php.net/manual/en/book.pthreads.php
4. Use php coroutine http://www.oschina.net/translate/cooperative-multitasking-using-coroutines-in-php
And so on.

Http://www.swoole.com/

The PHP High-Performance Network Communication Framework provides PHP asynchronous multi-threaded servers, asynchronous TCP/UDP network clients, asynchronous MySQL, database connection pool, AsyncTask, message queue, millisecond timer, asynchronous file read/write and asynchronous DNS query.
Swoole can be widely used in the Internet, mobile communications, enterprise software, online games, Iot, IOV, Smart Home, and other fields. Using PHP + Swoole as the network communication framework can greatly improve the efficiency of enterprise it r & D teams and focus more on developing innovative products.

Pthreads in PECL, or Baidu PHP pthreads

Using cli to perform a lot of data conversion, data upgrade, and data capturing, multithreading is quite good.

It's okay to start a sub-process. Why is it asynchronous? This is a problem with your own code implementation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.