Commit Graph

11 Commits (2e12586932d04b3d1efc2f353f88848cf5460bc7)

Author SHA1 Message Date
Angie Byron 7817a0a56e #758916 by chx and Damien Tournoud: Fixed Default queue implementation is hardwired. 2010-04-03 04:12:01 +00:00
Angie Byron 1f6a553cd2 #629794 follow-up by yched: Fixed batch API in update.php. 2010-01-09 02:51:09 +00:00
Angie Byron 0dd1612770 #629794 by yched: Fix Scaling issues with batch API. (with tests) 2010-01-08 06:36:34 +00:00
Dries Buytaert 775b4561fe - Patch #659710 by fgm: queue API was missing a releaseItem method. 2009-12-16 17:44:16 +00:00
Dries Buytaert fc6656b3c3 - Patch #602306 by alex_b: removed some unused code. 2009-10-31 13:53:48 +00:00
Dries Buytaert 30fa81a763 - Patch #602306 by David Strauss, Damien Tournoud: Fixed bug in the default queue implementation. 2009-10-14 10:59:15 +00:00
Dries Buytaert 76882b6fc6 - Patch #602306 by chx: simplify the default queue implementation. 2009-10-12 15:40:04 +00:00
Dries Buytaert db53d99659 - Patch #391340 by dww: documentation clean-up and correction. 2009-10-10 13:32:01 +00:00
Angie Byron e18feedfdb #564394 by Berdir and Crell: Removed database BC layer. nah nah nah nah... hey hey hey... gooood byeeee... 2009-09-18 00:04:24 +00:00
Dries Buytaert a24a6c2bba - Patch #471070 by stella: millions of code style fixes. 2009-05-24 17:39:35 +00:00
Dries Buytaert 4ef77a590c - Patch #391340 by chx, dww, neclimdul, Crell, alex_b, et al: job queue API.
The queue system allows placing items in a queue and processing them later.  The system tries to ensure that only one consumer can process an item.

Before a queue can be used it needs to be created by DrupalQueueInterface::createQueue().

Items can be added to the queue by passing an arbitrary data object to DrupalQueueInterface::createItem().

To process an item, call DrupalQueueInterface::claimItem() and specify how long you want to have a lease for working on that item. When finished processing, the item needs to be deleted by calling DrupalQueueInterface::deleteItem(). If the consumer dies, the item will be made available again by the DrapalQueueInterface implementation once the lease expires. Another consumer will then be able to receive it when calling DrupalQueueInterface::claimItem().

The $item object used by the DrupalQueueInterface can contain arbitrary metadata depending on the implementation. Systems using the interface should only rely on the data property which will contain the information passed to DrupalQueueInterface::createItem(). The full queue item returned by DrupalQueueInterface::createItem() needs to be passed to DrupalQueueInterface::deleteItem() once processing is completed.

While the queue system makes a best effort to preserve order in messages, due to the pluggable nature of the queue, there is no guarantee that items will be delivered on claim in the order they were sent. For example, some implementations like beanstalkd or others with distributed back-ends like Amazon SQS will be managing jobs for a large set of producers and consumers where a strict FIFO ordering will likely not be preserved.

The system also makes no guarantees about a task only being executed once: callers that have non-idempotent tasks either need to live with the possiblity of the task being invoked multiple times in cases where a claim lease expires, or need to implement their own transactions to make their tasks idempotent.
2009-05-06 10:37:28 +00:00