Php streaming php function call asynchronously

What I want to do is load some data from a database or from memcache asynchronously.

I know, I know. "PHP does not support threads."

But what about register_tick_function? Isn't that really a thread?

Has anyone performed any predictable preload or really any background processing using register_tick_function?

+37
php
Dec 12 '12 at 18:24
source share
1 answer

http://php.net/pthreads

http://docs.php.net/Thread

PHP can certainly support threads. Loading data from an SQL / NoSQL database in parallel is definitely an option. See the PHP manual, examples found in github and pecl packages, and a bit more information on http://pthreads.org

Please note that the documentation states that this is part of the kernel, this is (my) human error. You must install pthreads with the streaming version of php, it can be installed from pecl (windows incuded, dlls @ http://windows.php.net/downloads/pecl/releases/pthreads ). Apologies

+54
Dec 14
source share



All Articles