Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // MemcacheQ config
- $queueOptions = array(
- 'name' => 'example-queue',
- 'driverOptions' => array(
- 'host' => '127.0.0.1',
- 'port' => 22201
- )
- );
- // Instantiate Zend_Queue
- $queue = new Zend_Queue('MemcacheQ', $queueOptions);
- // Find out if the queue exists
- if (!$queue->getAdapter()->isExists($queueOptions['name']))
- {
- // If not, create it
- $queue->createQueue($queueOptions['name']);
- }
- // Build a query string (key=val&key=val) because we need a scalar value
- $params = http_build_query(
- array(
- 'timestamp' => $timestamp,
- 'page' => $page
- )
- );
- // Send the data to the queue
- $queue->send($params);
Add Comment
Please, Sign In to add comment