示例#1
0
 public function __construct(SessionManager $manager, Database $db)
 {
     parent::__construct($manager);
     $this->key = env('COMMON_SESSION');
     $this->redis = $db->connection('common');
     if ($this->redis === null) {
         throw new ResourceNotFoundException('Redis Common Connection is not exists.');
     }
 }
 public function testDelete()
 {
     $job = new RedisQueueIntegrationTestJob(30);
     $this->queue->push($job);
     /** @var RedisJob $redisJob */
     $redisJob = $this->queue->pop();
     $redisJob->delete();
     $this->assertEquals(0, $this->redis->connection()->zcard('queues:default:delayed'));
     $this->assertEquals(0, $this->redis->connection()->zcard('queues:default:reserved'));
     $this->assertEquals(0, $this->redis->connection()->llen('queues:default'));
     $this->assertNull($this->queue->pop());
 }
 /**
  * Get the Redis connection instance.
  *
  * @return \Predis\ClientInterface
  */
 public function connection()
 {
     return $this->redis->connection($this->connection);
 }
示例#4
0
 /**
  * Get a specific Redis connection instance.
  *
  * @param string $name
  * @return \Predis\ClientInterface 
  * @static 
  */
 public static function connection($name = 'default')
 {
     return \Illuminate\Redis\Database::connection($name);
 }
示例#5
0
 /**
  * Get the connection for the queue.
  *
  * @return \Predis\ClientInterface
  */
 protected function getConnection()
 {
     return $this->redis->connection($this->connection);
 }
 function __construct(RedisDatabase $redis)
 {
     $this->redis = $redis->connection();
 }