skymvc/library/cls_queue.php
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**左进右出*/
class queue{
public $list=array();
public $type="";
public $file;
public $key=1;
public function __construct($key=1,$type=""){
$this->type=$type;
if($this->type==""){
if(defined("QUEUE_TYPE") && QUEUE_TYPE!=''){
$this->type=QUEUE_TYPE;
}else{
$this->type="file";
}
}
$this->file="temp/queue_".$key.".txt";
$this->key=$key;
if($this->type=="redis"){
redisQueue::init();
}
}
/*入队*/
public function lpush($v){
switch($this->type){
case "file":
$this->file_lpush($v);
break;
case "redis":
redisQueue::lpush($this->k,$v);
break;
case "mysql":
mysqlQueue::lpush($this->k,$v);
break;
default:
array_unshift($this->list,$v);
break;
}
}
/*出队*/
public function rpop(){
switch($this->type){
case "file":
return $this->file_rpop();
break;
case "redis":
return redisQueue::rpop($this->k,$v);
break;
case "mysql":
return mysqlQueue::rpop($this->k);
break;
default:
后面还有 80 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。