public function SystemQueue::numberOfItems

cis7 system.queue.inc public SystemQueue::numberOfItems()
cle7 system.queue.inc public SystemQueue::numberOfItems()
elmsmedia7 system.queue.inc public SystemQueue::numberOfItems()
icor7 system.queue.inc public SystemQueue::numberOfItems()
meedjum_blog7 system.queue.inc public SystemQueue::numberOfItems()
mooc7 system.queue.inc public SystemQueue::numberOfItems()

Retrieve the number of items in the queue.

This is intended to provide a "best guess" count of the number of items in the queue. Depending on the implementation and the setup, the accuracy of the results of this function may vary.

e.g. On a busy system with a large number of consumers and items, the result might only be valid for a fraction of a second and not provide an accurate representation.

Return value

An integer estimate of the number of items in the queue.

Overrides DrupalQueueInterface::numberOfItems

File

modules/system/system.queue.inc, line 224
Queue functionality.

Class

SystemQueue
Default queue implementation.

Code

public function numberOfItems() {
  return db_query('SELECT COUNT(item_id) FROM {queue} WHERE name = :name', array(':name' => $this->name))->fetchField();
}