当前位置: 首页>>代码示例>>PHP>>正文


PHP GearmanClient::jobStatus方法代码示例

本文整理汇总了PHP中GearmanClient::jobStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP GearmanClient::jobStatus方法的具体用法?PHP GearmanClient::jobStatus怎么用?PHP GearmanClient::jobStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GearmanClient的用法示例。


在下文中一共展示了GearmanClient::jobStatus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: client

 public function client()
 {
     $config = $this->config->item('base_config');
     $host = $config['gearman']['host'];
     $port = $config['gearman']['port'];
     $client = new GearmanClient();
     $client->addServer($host, $port);
     $data = array('method' => 'get', 'url' => 'http://master.500mi.com/main/gearman/test', 'params' => array('wd' => '哈哈'));
     $job_handle = $client->doBackground("send_request", json_encode($data));
     if ($client->returnCode() != GEARMAN_SUCCESS) {
         echo "bad return code\n";
         exit;
     }
     $done = false;
     do {
         sleep(1);
         $stat = $client->jobStatus($job_handle);
         var_dump($stat);
         if (!$stat[0]) {
             $done = true;
         }
         echo "Running: " . ($stat[1] ? "true" : "false") . ", numerator: " . $stat[2] . ", denomintor: " . $stat[3] . "\n";
     } while (!$done);
     echo "done!\n";
 }
开发者ID:sdgdsffdsfff,项目名称:hiveAdmin,代码行数:25,代码来源:gearman.php

示例2: GearmanClient

<?php

$client = new GearmanClient();
$client->addServer();
$job_handle = $client->doBackground("setup", 1);
var_dump($job_handle);
if ($client->returnCode() != GEARMAN_SUCCESS) {
    echo "bad return code\n";
    exit;
}
$done = false;
do {
    sleep(3);
    $stat = $client->jobStatus($job_handle);
    if (!$stat[0]) {
        // the job is known so it is not done
        $done = true;
    }
    echo "Running: " . ($stat[1] ? "true" : "false") . ", numerator: " . $stat[2] . ", denomintor: " . $stat[3] . "\n";
} while (!$done);
echo "done!\n";
开发者ID:knatorski,项目名称:SMS,代码行数:21,代码来源:client.php

示例3: jobStatus

 public function jobStatus($jobHanle)
 {
     return $this->_gearmanClient->jobStatus($jobHanle);
 }
开发者ID:otis22,项目名称:reserve-copy-system,代码行数:4,代码来源:JobServer.php

示例4: GearmanClient

<?php

$c = new GearmanClient();
$c->addServer('127.0.0.1');
$h = $c->doBackground('abc', 'abc');
//while(true)
var_dump($c->jobStatus($h));
//exit;
$w = new GearmanWorker();
$w->addServer('127.0.0.1');
var_dump($w->addFunction('abc', function () {
    echo "123\n";
}, $ctx, 0));
while (true) {
    $w->work();
}
开发者ID:aftabnaveed,项目名称:hhvm-gearman,代码行数:16,代码来源:test.php

示例5: jobStatus

 /**
  * 
  * @param handle $job_handle
  * @return array
  */
 public function jobStatus($job_handle)
 {
     return $this->gearmanClient->jobStatus($job_handle);
 }
开发者ID:cimus,项目名称:gearman-bundle,代码行数:9,代码来源:GearmanClient.php

示例6: status

 /**
  * Returns the Gearman job status for any task or all tasks
  * 
  *     // Get the status of all tasks
  *     $statuses = $request
  *
  * @param   GearmanTask  task to return status for (optional)
  * @return  array
  */
 public function status(GearmanTask $task = NULL)
 {
     if ($task !== NULL) {
         return $this->_gearman_client->jobStatus($task->jobHandle());
     } else {
         $status = array();
         foreach ($this->_task_handles as $uuid => $task) {
             $status[$uuid] = $this->_gearman_client->jobStatus($task->jobHandle());
         }
         return $status;
     }
 }
开发者ID:samsoir,项目名称:vitesse,代码行数:21,代码来源:gearman.php


注:本文中的GearmanClient::jobStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。