PHP Class ResqueScheduler_Worker

Author: Chris Boulton ([email protected])
Afficher le fichier Open project: chrisboulton/php-resque-scheduler Class Usage Examples

Méthodes publiques

Свойство Type Description
$logLevel Current log level of this worker.

Protected Properties

Свойство Type Description
$interval Interval to sleep for between checking schedules.

Méthodes publiques

Méthode Description
enqueueDelayedItemsForTimestamp ( DateTime | integer $timestamp ) Schedule all of the delayed jobs for a given timestamp.
handleDelayedItems ( DateTime | integer $timestamp = null ) Handle delayed items for the next scheduled timestamp.
log ( string $message ) Output a given log message to STDOUT.
work ( integer $interval = null ) The primary loop for a worker.

Méthodes protégées

Méthode Description
sleep ( ) Sleep for the defined interval.

Private Methods

Méthode Description
updateProcLine ( string $status ) Update the status of the current worker process.

Method Details

enqueueDelayedItemsForTimestamp() public méthode

Searches for all items for a given timestamp, pulls them off the list of delayed jobs and pushes them across to Resque.
public enqueueDelayedItemsForTimestamp ( DateTime | integer $timestamp )
$timestamp DateTime | integer Search for any items up to this timestamp to schedule.

handleDelayedItems() public méthode

Searches for any items that are due to be scheduled in Resque and adds them to the appropriate job queue in Resque.
public handleDelayedItems ( DateTime | integer $timestamp = null )
$timestamp DateTime | integer Search for any items up to this timestamp to schedule.

log() public méthode

Output a given log message to STDOUT.
public log ( string $message )
$message string Message to output.

sleep() protected méthode

Sleep for the defined interval.
protected sleep ( )

work() public méthode

Every $interval (seconds), the scheduled queue will be checked for jobs that should be pushed to Resque.
public work ( integer $interval = null )
$interval integer How often to check schedules.

Property Details

$interval protected_oe property

Interval to sleep for between checking schedules.
protected $interval

$logLevel public_oe property

Current log level of this worker.
public $logLevel