redis队列

push.php

<?php
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$password = 'password';
$redis->auth($password);
$arr = array('0','1','2','3','4','5','6','7','8','9');
foreach($arr as $k=>$v){
  $redis->rpush("mylist",$v);
}

msg.php

<?php
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$password = 'password';
$redis->auth($password);
//list类型出队操作
$value = $redis->lpop('mylist');
if($value){
 echo "出队的值".$value;
}else{
  echo "出队完成";
}
 
?>

点击链接加入群聊:企鹅群:827944755

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页