- /**
- * Pop the oldest unclaimed item off the queue set and claim it.
- *
- * @return mixed false if no items; true if bogus hit; otherwise array(string, Notice)
- * giving the queue transport name.
- */
- protected function _nextItem()
- {
- $start = time();
- $result = null;
-
- $qi = Queue_item::top();
- if (empty($qi)) {
- return false;
- }
-
- $queue = $qi->transport;
- $notice = Notice::staticGet('id', $qi->notice_id);
- if (empty($notice)) {
- $this->_log(LOG_INFO, "[$queue:notice $notice->id] dequeued non-existent notice");
- $qi->delete();
- return true;
- }
-
- $result = $notice;
- return array($queue, $notice);
- }
-