How does php implement non-blocking tasks?

problem description

I just want to simply use php to implement non-blocking tasks

  https://github.com/reactphp

what I want to implement is that there are some tasks in function,function in do. After careful consideration, it should not be possible to implement this operation, because the context of asynchronous tasks has changed. I wonder if my understanding is correct?


PHP itself is executed sequentially, and there is no use of asynchronous callbacks or what you call non-blocking usage.

if it is a CLI-based application, you can try to use swoole to implement it. Swoole is an extension of PHP that implements asynchronous non-blocking operations.


workerman learn about pure php.

add:
did not see the link you gave, just a simple idea, similar to the method of writing callback in nodejs;

  

by default, a single-threaded implementation cannot be implemented by
recompiling to turn on multithreaded mode.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45b90-4409e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45b90-4409e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?