Ejemplo n.º 1
0
 public function testRemove()
 {
     $this->rediska->addToSet('test', 123);
     $reply = $this->set->remove(123);
     $this->assertTrue($reply);
     $reply = $this->rediska->existsInSet('test', 123);
     $this->assertFalse($reply);
 }
Ejemplo n.º 2
0
 /**
  * Delete a queue from the queues set
  *
  * @param $name
  * @return bool
  */
 public function remove($name)
 {
     $result = $this->_queuesSet->remove($name);
     if ($result) {
         $queuesCache = $this->_getQueuesCache();
         $key = array_search($name, $queuesCache);
         unset($queuesCache[$key]);
         $this->_setQueuesCache($queuesCache);
     }
     return $result;
 }
Ejemplo n.º 3
0
 public function testRemove()
 {
     $this->rediska->addToSortedSet('test', 123, 1);
     $reply = $this->set->remove(123);
     $this->assertTrue($reply);
     $values = $this->rediska->getSortedSet('test');
     $this->assertTrue(empty($values));
     $this->rediska->addToSortedSet('test', 123, 1);
     unset($this->set[1]);
     $values = $this->rediska->getSortedSet('test');
     $this->assertTrue(empty($values));
 }
Ejemplo n.º 4
0
 /**
  * Delete a queue and all of it's messages
  *
  * Returns false if the queue is not found, true if the queue exists
  *
  * @param  string  $name queue name
  * @return boolean
  */
 public function delete($name)
 {
     if ($this->_queues->remove($name)) {
         if (isset($this->_queueObjects[$name])) {
             unset($this->_queueObjects[$name]);
         }
         return $this->_rediska->delete($this->_getKeyName("queue_{$name}"));
     }
 }