Net_Gearman
[ class tree: Net_Gearman ] [ index: Net_Gearman ] [ all elements ]

Source for file tasks.php

Documentation is available at tasks.php

  1. <?php
  2.  
  3. require_once 'Net/Gearman/Client.php';
  4.  
  5. $set = new Net_Gearman_Set();
  6.  
  7. function result($resp{
  8.     print_r($resp);
  9. }
  10.  
  11. $sql = array(
  12.     "SELECT * FROM users WHERE username = 'joestump'",
  13.     "SELECT * FROM users WHERE username LIKE 'joe%' LIMIT 10",
  14.     "SELECT * FROM items WHERE deleted = 0 LIMIT 10"
  15. );
  16.  
  17. foreach ($sql as $s{
  18.     $task = new Net_Gearman_Task('SQL'array(
  19.         'sql' => $s
  20.     ));
  21.  
  22.     $task->attachCallback('result');
  23.     $set->addTask($task);
  24. }
  25.  
  26. $client = new Net_Gearman_Client(array('dev01'));
  27. $client->runSet($set);
  28.  
  29. ?>

Documentation generated on Mon, 11 Mar 2019 15:21:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.