Skip to content
  1. Oct 12, 2012
  2. Jun 14, 2012
  3. Jun 12, 2012
  4. Jun 08, 2012
  5. Jun 07, 2012
  6. Jun 06, 2012
  7. Jun 05, 2012
  8. Jun 03, 2012
  9. Jun 02, 2012
  10. Jun 01, 2012
  11. May 30, 2012
  12. May 04, 2012
  13. May 03, 2012
  14. Apr 13, 2012
  15. Mar 15, 2012
  16. Mar 14, 2012
  17. Mar 12, 2012
  18. Mar 11, 2012
  19. Mar 10, 2012
  20. Nov 01, 2011
  21. Mar 21, 2011
  22. Feb 25, 2011
  23. Dec 20, 2010
  24. Dec 15, 2009
  25. Nov 17, 2009
  26. Oct 15, 2009
  27. Aug 31, 2009
  28. Aug 19, 2009
  29. Jun 17, 2009
  30. Jun 08, 2009
  31. May 06, 2009
    • Dries Buytaert's avatar
      - Patch #391340 by chx, dww, neclimdul, Crell, alex_b, et al: job queue API. · 4ef77a59
      Dries Buytaert authored
      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.
      4ef77a59