db = new \Redis; $config = Dever::config('base')->queue; $host = Dever::config('base')->queue['host']; $port = Dever::config('base')->queue['port']; $this->db->connect($config['host'], $config['port']); if (isset($config['password'])) { $this->db->auth($config['password']); } if (isset($config['key']) && $config['key']) { $this->key = $config['key']; } } public function push($value, $key) { return $this->db->rpush($key, $value); } public function pop($key) { $data = $this->db->lpop($key); if ($data) { return $data; } return false; } public function len($key) { return $this->db->llen($key); } }