Example #1
0
 public function actionTest()
 {
     $modelTest = new ModelPdo();
     $result = $modelTest->testInsert();
     var_dump($result);
     $result = $modelTest->testQuery();
     var_dump($result);
 }
Example #2
0
 public static function testTask($serv, $task_id, $from_id, $data)
 {
     $modelTest = new ModelPdo();
     $result = $modelTest->testInsert();
     sleep(1);
     echo "This Task {$task_id} from Worker {$from_id}\n";
     //echo "Data: {$data}\n";
     /*for ($i = 0; $i < 10; $i++) {
       sleep(1);
       echo "Taks {$task_id} Handle {$i} times...\n";
        */
     //$fd = json_decode($data, true)['fd'];
     //$serv->send($fd, "Data in Task {$task_id}");
     echo "Task {$task_id}'s result {$result}";
 }