// For configuration options
// @see Zend_Queue_Adapater::__construct()
'name' => 'queue1',
);
// Create an array queue
$queue = new Zend_Queue('Array', $options);
// Get list of queues
foreach ($queue->getQueues() as $name) {
}
// Create a new queue
$queue2 = $queue->createQueue('queue2');
// Get number of messages in a queue (supports Countable interface from SPL)
// Get up to 5 messages from a queue
$messages = $queue->receive(5);
foreach ($messages as $i => $message) {
echo $message->
body,
"\n";
// We have processed the message; now we remove it from the queue.
$queue->deleteMessage($message);
}
// Send a message to the currently active queue
$queue->send('My Test Message');
// Delete a queue we created and all of it's messages
$queue->deleteQueue('queue2');