Jenner\SimpleFork\Queue\RedisQueue::size PHP Method

size() public method

get the size of the queue
public size ( ) : integer
return integer
    public function size()
    {
        return $this->redis->lSize($this->channel);
    }

Usage Example

 public function testAll()
 {
     if (!extension_loaded("Redis")) {
         $this->markTestSkipped("Redis extension is not loaded");
     }
     $this->queue = new \Jenner\SimpleFork\Queue\RedisQueue();
     $this->assertTrue($this->queue->put('test'));
     $this->assertEquals($this->queue->get(), 'test');
     $this->assertEquals($this->queue->size(), 0);
     $this->queue->close();
 }