PHP Class Resque\Host

Author: Michael Haynes ([email protected])
Afficher le fichier Open project: mjphaynes/php-resque Class Usage Examples

Protected Properties

Свойство Type Description
$hostname The hostname
$redis The Redis instance
$timeout Host key timeout

Méthodes publiques

Méthode Description
__construct ( $hostname = null ) Create a new host
__toString ( ) : string Generate a string representation of this worker.
cleanup ( ) : array Cleans up any dead hosts
finished ( Worker $worker ) Mark host as having a finished worker
redisKey ( Host $host = null, string $suffix = null ) : string Get the Redis key
working ( Worker $worker ) Mark host as having an active worker

Method Details

__construct() public méthode

Create a new host
public __construct ( $hostname = null )

__toString() public méthode

Generate a string representation of this worker.
public __toString ( ) : string
Résultat string Identifier for this worker instance.

cleanup() public méthode

Cleans up any dead hosts
public cleanup ( ) : array
Résultat array List of cleaned hosts

finished() public méthode

Mark host as having a finished worker
public finished ( Worker $worker )
$worker Worker The worker instance

redisKey() public static méthode

Get the Redis key
public static redisKey ( Host $host = null, string $suffix = null ) : string
$host Host The host to get the key for
$suffix string To be appended to key
Résultat string

working() public méthode

Mark host as having an active worker
public working ( Worker $worker )
$worker Worker the worker instance

Property Details

$hostname protected_oe property

The hostname
protected $hostname

$redis protected_oe property

The Redis instance
protected $redis

$timeout protected_oe property

Host key timeout
protected $timeout