PHP Class Cml\Queue\Redis

Inheritance: extends Base
Show file Open project: linhecheng/cmlphp

Public Methods

Method Description
__construct ( mixed $useCache = false ) Redis队列驱动
lPop ( string $name ) : mixed 从列表头出队
lPush ( string $name, mixed $data ) : mixed 从列表头入队
rPop ( string $name ) : mixed 从列表尾出队
rPopLpush ( string $from, string $to ) : mixed 弹入弹出
rPush ( string $name, mixed $data ) : mixed 从列表尾入队

Private Methods

Method Description
getDriver ( ) : Redis 返回驱动

Method Details

__construct() public method

Redis队列驱动
public __construct ( mixed $useCache = false )
$useCache mixed 使用的缓存配置key,未传则获取redis_queue_use_cache中配置的key

lPop() public method

从列表头出队
public lPop ( string $name ) : mixed
$name string 要从列表头出队的队列的名称
return mixed

lPush() public method

从列表头入队
public lPush ( string $name, mixed $data ) : mixed
$name string 要从列表头入队的队列的名称
$data mixed 要入队的数据
return mixed

rPop() public method

从列表尾出队
public rPop ( string $name ) : mixed
$name string 要从列表尾出队的队列的名称
return mixed

rPopLpush() public method

弹入弹出
public rPopLpush ( string $from, string $to ) : mixed
$from string 要弹出的队列名称
$to string 要入队的队列名称
return mixed

rPush() public method

从列表尾入队
public rPush ( string $name, mixed $data ) : mixed
$name string 要从列表尾入队的队列的名称
$data mixed 要入队的数据
return mixed