PHP Class Jenner\SimpleFork\Queue\RedisQueue

Inheritance: implements Jenner\SimpleFork\Queue\QueueInterface
Show file Open project: huyanping/simple-fork-php Class Usage Examples

Protected Properties

Property Type Description
$channel redis key of queue
$redis Redis

Public Methods

Method Description
__construct ( string $host = '127.0.0.1', integer $port = 6379, integer $database, string $channel = 'cache', string $prefix = 'simple-fork-' )
__destruct ( ) close the connection
close ( ) close the connection
get ( boolean $block = false ) : boolean | string get value from the queue
put ( $value ) : boolean put value into the queue
remove ( ) : mixed remove the queue resource
size ( ) : integer get the size of the queue

Method Details

__construct() public method

public __construct ( string $host = '127.0.0.1', integer $port = 6379, integer $database, string $channel = 'cache', string $prefix = 'simple-fork-' )
$host string redis server host
$port integer redis server port
$database integer redis server database num
$channel string redis queue key
$prefix string prefix of redis queue key

__destruct() public method

close the connection
public __destruct ( )

close() public method

close the connection
public close ( )

get() public method

get value from the queue
public get ( boolean $block = false ) : boolean | string
$block boolean if block when the queue is empty
return boolean | string

put() public method

put value into the queue
public put ( $value ) : boolean
$value
return boolean

remove() public method

remove the queue resource
public remove ( ) : mixed
return mixed

size() public method

get the size of the queue
public size ( ) : integer
return integer

Property Details

$channel protected property

redis key of queue
protected $channel

$redis protected property

protected Redis $redis
return Redis