FrameworkThe Zend_Queue is a proxy that hides the details of the queue services. The queue services are represented by Zend_Queue_Adapter_<service>. For example, Zend_Queue_Adapter_Db is a queue that will use database tables to store and retrieve messages. Below is an example for using database tables for a queuing system:
The Zend_Queue constructor will create a Zend_Queue_Adapter_Db and initialize the adapter with the configuration settings. The accepted configuration settings for each adapter are provided in the adapter notes. Zend_Queue returns messages using the class Zend_Queue_Message_Iterator, which is an implementation of SPL Iterator and Countable. Zend_Queue_Message_Iterator contains an array of Zend_Queue_Message objects.
Any exceptions thrown are of class Zend_Queue_Exception. IntroductionZend_Queue is a proxy class that represents an adapter. The send(), count($queue), and receive() methods are employed by each adapter to interact with queues. The createQueue(), deleteQueue() methods are used to manage queues. Commonality among adaptersThe queue services supported by Zend_Queue do not all support the same functions. For example, Zend_Queue_Adapter_Array, Zend_Queue_Adapter_Db, support all functions, while Zend_Queue_Adapter_Activemq does not support queue listing, queue deletion, or counting of messages. You can determine what functions are supported by using Zend_Queue::isSupported() or Zend_Queue::getCapabilities().
receive() methods are employed by each adapter to interact with queues. The createQueue() and deleteQueue() methods are used to manage queues.
|