當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GearmanClient::setDataCallback方法代碼示例

本文整理匯總了PHP中GearmanClient::setDataCallback方法的典型用法代碼示例。如果您正苦於以下問題:PHP GearmanClient::setDataCallback方法的具體用法?PHP GearmanClient::setDataCallback怎麽用?PHP GearmanClient::setDataCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GearmanClient的用法示例。


在下文中一共展示了GearmanClient::setDataCallback方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initCallbacks

 public function initCallbacks()
 {
     $this->client->setStatusCallback([$this, 'handleStatus']);
     $this->client->setDataCallback([$this, 'handleData']);
     $this->client->setCompleteCallback([$this, 'handleComplete']);
     $this->client->setFailCallback([$this, 'handleFail']);
     $this->client->setWarningCallback([$this, 'handleWarning']);
     return null;
 }
開發者ID:jamset,項目名稱:gearman-conveyor,代碼行數:9,代碼來源:BaseGearmanClient.php

示例2: assignTaskCallbacks

 /**
  * Assign all GearmanClient callbacks as Symfony2 events
  *
  * @param \GearmanClient $gearmanClient Gearman client
  *
  * @return GearmanCallbacksDispatcher self Object
  */
 public function assignTaskCallbacks(\GearmanClient $gearmanClient)
 {
     $gearmanClient->setCompleteCallback(array($this, 'assignCompleteCallback'));
     $gearmanClient->setFailCallback(array($this, 'assignFailCallback'));
     $gearmanClient->setDataCallback(array($this, 'assignDataCallback'));
     $gearmanClient->setCreatedCallback(array($this, 'assignCreatedCallback'));
     $gearmanClient->setExceptionCallback(array($this, 'assignExceptionCallback'));
     $gearmanClient->setStatusCallback(array($this, 'assignStatusCallback'));
     $gearmanClient->setWarningCallback(array($this, 'assignWarningCallback'));
     $gearmanClient->setWorkloadCallback(array($this, 'assignWorkloadCallback'));
 }
開發者ID:eduardtrandafir,項目名稱:gearman-bundle,代碼行數:18,代碼來源:GearmanCallbacksDispatcher.php

示例3: __construct

 /**
  * Constructor method checks for gearman
  * 
  * @throws  Kohana_Request_Exception
  */
 public function __construct()
 {
     if (!extension_loaded('gearman')) {
         throw new Kohana_Request_Exception('Unable to load PHP Gearman. Check your local environment.');
     }
     // Create a new Gearman client and add a server
     $this->_gearman_client = new GearmanClient();
     /**
      * @todo    support multiple Gearman servers
      * @todo    support customisable servers
      */
     if (!$this->_gearman_client->addServer()) {
         throw new Kohana_Request_Exception('Unable to attach to Gearman server');
     }
     // Setup callback functions for Gearman tasks
     $this->_gearman_client->setDataCallback(array($this, '_task_data'));
     $this->_gearman_client->setFailCallback(array($this, '_task_failed'));
     $this->_gearman_client->setCompleteCallback(array($this, '_task_complete'));
     $this->_gearman_client->setExceptionCallback(array($this, '_task_exception'));
 }
開發者ID:samsoir,項目名稱:vitesse,代碼行數:25,代碼來源:gearman.php


注:本文中的GearmanClient::setDataCallback方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。