xtox('btoc'); } public function xtox($listname){ $redis = new \Redis(); $redis->connect('39.97.239.116', 6379); $redis->auth('huaxiashangmeng'); $redis->select(1); while(true){ try{ $value = $redis->BRPOP($listname,0); if(!$value){ break; } return $value; }catch(Exception $e){ return $e->getMessage(); } } } }