コード例 #1
0
 public function doHigh($task, $data)
 {
     return $this->_gearmanClient->doHigh($task, $data);
 }
コード例 #2
0
 public function doHigh($function_name, $workload, $unique = null)
 {
     $function_name = $this->_processFunctionName($function_name);
     return parent::doHigh($function_name, $workload, $unique);
 }
コード例 #3
0
ファイル: stop-worker.php プロジェクト: cweiske/phinde
#!/usr/bin/env php
<?php 
//stop a single running worker
namespace phinde;

require_once __DIR__ . '/../src/init.php';
$gmclient = new \GearmanClient();
$gmclient->addServer('127.0.0.1');
$gmclient->doHigh($GLOBALS['phinde']['queuePrefix'] . 'phinde_quit', 'none');
コード例 #4
0
ファイル: photo.php プロジェクト: momoim/momo-api
 /**
  * 
  * 图片旋转接口
  * GET rotate/:id.json?direction={方向}&size={尺寸}
  */
 public function rotate($pid)
 {
     $direction = intval($_GET['direction']);
     $size = intval($_GET['size']);
     $size = in_array($size, Core::config('photo_standard_type')) ? $size : 130;
     if ($direction != -1) {
         $direction = 1;
     }
     if (!$pid) {
         $this->response(ResponseType::ERROR_LACKPARAMS);
     }
     $client = new GearmanClient();
     $client->addServers(Core::config('job_servers'));
     $client->setTimeout(3000);
     $result = @$client->doHigh("rotate", serialize(array($pid, $direction)));
     $result && ($sid = @unserialize($result));
     if (!$sid) {
         $thumb = new Thumb();
         if ($thumb->rotate(NULL, $pid, $direction)) {
             $sid = TRUE;
         }
     }
     if ($sid) {
         $photoModel = new Models\Photo();
         $imgurls = $photoModel->geturi($pid, $size);
         $return['src'] = $imgurls[0];
         $this->response(ResponseType::PHOTO_ROTATE_OK, '', $return);
     } else {
         $this->response(ResponseType::PHOTO_ROTATE_ERROR);
     }
 }