Asynchronous and real-time

How I can make my functions or requests in the framework work asynchronously, like doing things in real time. what I can do from Phalcon or would have to implement a separate library.

Thanks



82.7k

IMHO PHP has not been designed to work asynchronously, while PHP provides thread safety, there are still several global resources that aren't isolated, this means two functions may try to access the same resource leading to unexpected behaviors.

However, there are efforts to provide multi-tasking and non-blocking I/O in PHP:

pthreads - http://www.php.net/manual/en/intro.pthreads.php (support for threads/multi-tasking) ev - http://www.php.net/manual/en/intro.ev.php (to create non-blocking event loops) pcntl - http://www.php.net/manual/en/book.pcntl.php (to fork PHP processes)

Thank you very much for the info :D ;)



6.5k

use nodeJs