当前位置: 首页>>代码示例>>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;未经允许,请勿转载。