|Ratings|| ||Unique User Downloads|| ||Download Rankings|
| 61%||Total: 2,547 ||All time: 1,509 This week: 129|
This class can run emulated parallel threads with HTTP requests to the same server.
It can create parallel threads to run given PHP code by sending HTTP requests to an URL of the same server handled by a script that will execute a given function with optional arguments also passed in the HTTP request.
The class can also handle the HTTP requests to the emulated threads.
On the calling side, the class can check if the emulated thread has finished and retrieves the result as the HTTP response.
* Multi Threading
* @author Bijaya Kumar
* @email email@example.com
* @mobile +91 9911033016
* @link http://www.digitalwebsolutions.in
// require class
// global function
// start time
$time = time () ;
$doSleep_response = NULL;
$response2 = NULL;
// start thread #1, with receive return value with param value 10
mThread::start( array( 'doSleep', &$doSleep_response), 10 ,'bijaya' ) ;
//start thread #2, without receive return value with param value 10
mThread::start( 'doSleep1', 10 , 'kulvir' ) ;
// start thread #3, without receive return value with param value 10
mThread::start( 'doSleep2', 10 , 'ajit' ) ;
// running till completed
while ( mThread::runing () ) ;
echo "----------------------<br />" ;
echo "Response Return from doSleep <br />" ;
echo "<br />----------------------<br />" ;
echo "====================<br /> Tooks " . (time () - $time ) . ' Secs. 3 threads,<br />====================' ;
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.