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


PHP Zend_Queue::send方法代码示例

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


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

示例1: queueAction

 /**
  * queues an action
  * 
  * @param string $_action
  * @param mixed  $_arg1
  * @param mixed  $_arg2
  * ...
  * 
  * @return string the job id
  */
 public function queueAction()
 {
     $params = func_get_args();
     $action = array_shift($params);
     $message = array('action' => $action, 'account_id' => Tinebase_Core::getUser()->getId(), 'params' => $params);
     if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) {
         Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . " queueing action: '{$action}'");
     }
     return $this->_queue->send($message);
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:20,代码来源:ActionQueue.php

示例2: send

 public function send($template)
 {
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
     $queue = new Zend_Queue('Activemq', $config->queue->activemq->toArray());
     $data = array();
     $data['RecipientEmail'] = $template->getRecipientEmail();
     $data['RecipientName'] = $template->getRecipientName();
     $data['From'] = $template->getFrom();
     $data['Subject'] = $template->getSubject();
     $data['BodyText'] = $template->getBodyText();
     $data['BodyHtml'] = $template->getBodyHtml();
     $data['SenderEmail'] = $template->getSenderEmail();
     $data['SenderName'] = $template->getSenderName();
     $message = $queue->send(serialize($data));
 }
开发者ID:revoleers,项目名称:rewardimizer-server,代码行数:15,代码来源:Mail.php

示例3: send

 /**
  * Send a message to the queue
  *
  * @param  Custom_Message|Custom_Messages $message message
  * @return $this
  * @throws Zend_Queue_Exception
  */
 public function send($message)
 {
     if (!($message instanceof Custom_Message || $message instanceof Custom_Messages)) {
         /**
          * @see Zend_Queue_Exception
          */
         require_once 'Zend/Queue/Exception.php';
         throw new Zend_Queue_Exception('$message must be an instance of Custom_Message or Custom_Messages');
     }
     if ($message instanceof Custom_Message) {
         $response = parent::send($message->__toString());
     } else {
         foreach ($message as $i => $one) {
             $response = parent::send($one->__toString());
         }
     }
     return $this;
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:25,代码来源:Queue.php

示例4: start

 public function start(Zend_Queue $q)
 {
     Loader::library('database_indexed_search');
     $this->is = new IndexedSearch();
     Loader::model('attribute/categories/collection');
     Loader::model('attribute/categories/file');
     Loader::model('attribute/categories/user');
     $attributes = CollectionAttributeKey::getList();
     $attributes = array_merge($attributes, FileAttributeKey::getList());
     $attributes = array_merge($attributes, UserAttributeKey::getList());
     foreach ($attributes as $ak) {
         $ak->updateSearchIndex();
     }
     $db = Loader::db();
     $db->Execute('truncate table PageSearchIndex');
     $r = $db->Execute('select Pages.cID from Pages left join CollectionSearchIndexAttributes csia on Pages.cID = csia.cID where (ak_exclude_search_index is null or ak_exclude_search_index = 0) and cIsActive = 1');
     while ($row = $r->FetchRow()) {
         $q->send($row['cID']);
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:20,代码来源:index_search_all.php

示例5: testReceiveWillRetrieveZeroItems

 /**
  * @group ZF-7650
  */
 public function testReceiveWillRetrieveZeroItems()
 {
     $options = $this->getTestConfig();
     $options['name'] = '/temp-queue/ZF7650';
     $queue = new Zend_Queue('Db', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:omusico,项目名称:logica,代码行数:14,代码来源:DbTest.php

示例6: test_ZF_7650

 public function test_ZF_7650()
 {
     // Zend_Queue_Adapter_Array
     $queue = new Zend_Queue('Array');
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
     // Zend_Queue_Adapter_Memcacheq
     $driverOptions = array();
     if (defined('TESTS_ZEND_QUEUE_MEMCACHEQ_HOST')) {
         $driverOptions['host'] = TESTS_ZEND_QUEUE_MEMCACHEQ_HOST;
     }
     if (defined('TESTS_ZEND_QUEUE_MEMCACHEQ_PORT')) {
         $driverOptions['port'] = TESTS_ZEND_QUEUE_MEMCACHEQ_PORT;
     }
     $options = array('name' => 'ZF7650', 'driverOptions' => $driverOptions);
     $queue = new Zend_Queue('Memcacheq', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
     // Zend_Queue_Adapter_Db
     $driverOptions = array();
     if (defined('TESTS_ZEND_QUEUE_DB')) {
         require_once 'Zend/Json.php';
         $driverOptions = Zend_Json::decode(TESTS_ZEND_QUEUE_DB);
     }
     $options = array('name' => '/temp-queue/ZF7650', 'options' => array(Zend_Db_Select::FOR_UPDATE => true), 'driverOptions' => $driverOptions);
     $queue = new Zend_Queue('Db', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
     // Zend_Queue_Adapter_Activemq
     $driverOptions = array();
     if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_HOST')) {
         $driverOptions['host'] = TESTS_ZEND_QUEUE_ACTIVEMQ_HOST;
     }
     if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_PORT')) {
         $driverOptions['port'] = TESTS_ZEND_QUEUE_ACTIVEMQ_PORT;
     }
     if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_SCHEME')) {
         $driverOptions['scheme'] = TESTS_ZEND_QUEUE_ACTIVEMQ_SCHEME;
     }
     $options = array('driverOptions' => $driverOptions);
     $queue = new Zend_Queue('Activemq', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:travisj,项目名称:zf,代码行数:56,代码来源:ZF-7650Test.php

示例7: testReceiveWillRetrieveZeroItems

 /**
  * @group ZF-7650
  */
 public function testReceiveWillRetrieveZeroItems()
 {
     $options = array('driverOptions' => $this->getTestConfig());
     $queue = new Zend_Queue('Activemq', $options);
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:omusico,项目名称:logica,代码行数:13,代码来源:ActivemqTest.php

示例8: testReceiveWillRetrieveZeroItems

 /**
  * @group ZF-7650
  */
 public function testReceiveWillRetrieveZeroItems()
 {
     // Zend_Queue_Adapter_Array
     $queue = new Zend_Queue('Array');
     $queue2 = $queue->createQueue('queue');
     $queue->send('My Test Message 1');
     $queue->send('My Test Message 2');
     $messages = $queue->receive(0);
     $this->assertEquals(0, count($messages));
 }
开发者ID:omusico,项目名称:logica,代码行数:13,代码来源:ArrayTest.php

示例9: saveMailLists

    }
    $sendresult[$key] = array($email, $receive_name);
    $receiverinfo .= $email . "," . $receive_name . ";";
}
$maillogsidstr = '';
$totalnum = 0;
$arr = array();
$current_user_id = $current_user->id;
foreach ($sendresult as $rst) {
    //生成日志ID
    $maillogsid = $adb->getUniqueID("ec_maillogs");
    $maillogsidstr .= $maillogsid . ",";
    $to_email = $rst[0];
    $receiver = $rst[1];
    $message = "sjid={$sjid}&maillogsid={$maillogsid}&to_email={$to_email}&receiver={$receiver}&from_name={$from_name}&from_email={$from_email}&interval={$interval}&subject={$subject}&mailcontent={$mailcontent}&userid=" . $current_user_id;
    $queue->send($message);
    $totalnum++;
}
//保存事件
saveMailLists($sjid, $subject, $mailcontent, $maillogsidstr, $receiverinfo, $from_name, $from_email, $totalnum);
echo "SUCCESS";
die;
exit;
//list
function saveMailLists($sjid, $subject, $mailcontent, $maillogsidstr, $receiverinfo, $from_name, $from_email, $totalnum)
{
    global $adb;
    global $current_user;
    $maillistname = "QFYJ" . date("Ymd") . "-" . $sjid;
    $mailcontent = addslashes($mailcontent);
    $sql = "insert into ec_maillists(maillistsid,maillistname,smcreatorid,createdtime,deleted,mailids,receiverinfo,from_name,from_email,subject,mailcontent,totalnum) values(" . $sjid . ",'" . $maillistname . "','" . $current_user->id . "','" . date("Y-m-d H:i:s") . "',0,'" . $maillogsidstr . "','" . $receiverinfo . "','" . $from_name . "','" . $from_email . "','" . $subject . "','" . $mailcontent . "','" . $totalnum . "')";
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:SendMailToAll.php

示例10: send

 public function send($message)
 {
     parent::send((string) $message);
 }
开发者ID:sasezaki,项目名称:spizer,代码行数:4,代码来源:MessageQueue.php

示例11: addTask

 /**
  * Add task to queue
  *
  * array (
  *     'task_name' => '...',
  *     'params' => array(),
  * )
  *
  * @param array $task
  * @return Enterprise_Queue_Model_Consumer
  */
 public function addTask(array $task)
 {
     $this->_queue->send(Zend_Json::encode($task));
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:16,代码来源:Consumer.php


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