Browse Source

* Add and remove queue name from internal array during create() and delete()

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@18847 44c647ce-9c0f-0410-b52a-842ac1e357ba
jplock 16 years ago
parent
commit
54bc66c733
1 changed files with 7 additions and 0 deletions
  1. 7 0
      library/Zend/Queue/Adapter/Memcacheq.php

+ 7 - 0
library/Zend/Queue/Adapter/Memcacheq.php

@@ -171,6 +171,8 @@ class Zend_Queue_Adapter_Memcacheq extends Zend_Queue_Adapter_AdapterAbstract
         // depend on the current name.
         $result = $this->_cache->set($name, 'creating queue', 0, 15);
         $result = $this->_cache->get($name);
+        
+        $this->_queues[] = $name;
 
         return true;
     }
@@ -189,6 +191,11 @@ class Zend_Queue_Adapter_Memcacheq extends Zend_Queue_Adapter_AdapterAbstract
         $response = $this->_sendCommand('delete ' . $name, array('DELETED', 'NOT_FOUND'), true);
 
         if (in_array('DELETED', $response)) {
+            $key = array_search($name, $this->_queues);
+
+            if ($key !== false) {
+                unset($this->_queues[$key]);
+            }
             return true;
         }