Patterns for PHP multi processes?

后端 未结 7 920
囚心锁ツ
囚心锁ツ 2020-12-06 02:54

Which design pattern exist to realize the execution of some PHP processes and the collection of the results in one PHP process?

Background:
I do

7条回答
  •  孤街浪徒
    2020-12-06 03:30

    You could use a more efficient data structure, such as a btree. I used once in Java but not in PHP. You can try this script: http://www.phpclasses.org/browse/file/708.html, it is an implementation of btree.

    If it is not enough, you can use Hadoop to implement a Map/Reduce pattern, as Michael said. I would not fork PHP process, it does not seem to help for performace.

    Personally, I would use PHP as client and put everything in Hadoop. This tutorial might help: http://www.lunchpauze.com/2007/10/writing-hadoop-mapreduce-program-in-php.html.

    Another solution can be to use a Java implementation of Btree: http://jdbm.sourceforge.net/. JDBM is an object database using a Btree+ data astructures. Then you can search with PHP by exposing data with a web service or by accessing it directly with Quercus

提交回复
热议问题