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

put() public method

put value into the queue
public put ( $value ) : boolean
$value
return boolean
    public function put($value)
    {
        if ($this->redis->lPush($this->channel, $value) !== false) {
            return true;
        }
        return false;
    }

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();
 }