コード例 #1
0
 /**
  * Add a task to the queue
  * 
  * @param Lilmuckers_Queue_Model_Queue      $queue The queue identifier
  * @param Lilmuckers_Queue_Model_Queue_Task $task  The task to queue
  * 
  * @return Lilmuckers_Queue_Model_Queue_Abstract
  */
 public function addTask(Lilmuckers_Queue_Model_Queue_Abstract $queue, Lilmuckers_Queue_Model_Queue_Task $task)
 {
     //ensure the queue connection is loaded
     $this->_loadConnection();
     //queue this stuff up
     $this->_addToQueue($queue->getName(), $task);
     return $this;
 }
コード例 #2
0
 /**
  * Get the next held job in the queue without reserving it
  * 
  * @param Lilmuckers_Queue_Model_Queue_Abstract $queue Queue to peek at
  * 
  * @return Lilmuckers_Queue_Model_Queue_Task
  */
 protected function _getUnreservedHeldTask(Lilmuckers_Queue_Model_Queue_Abstract $queue)
 {
     //peek at the next ready job
     $_job = $this->getConnection()->peekBuried($queue->getName());
     //turn it into a task
     return $this->_prepareJob($_job);
 }