PHP Class Queue\Shell\QueueShell

Inheritance: extends Cake\Console\Shell
Afficher le fichier Open project: dereuromark/cakephp-queue Class Usage Examples

Méthodes publiques

Свойство Type Description
$modelClass string

Protected Properties

Свойство Type Description
$_exit boolean
$_taskConf array

Méthodes publiques

Méthode Description
__destruct ( ) Destructor, removes pid-file
add ( ) : void Look for a Queue Task of hte passed name and try to call add() on it.
clean ( ) : void Manually trigger a Finished job cleanup.
getOptionParser ( ) : Cake\Console\ConsoleOptionParser Get option parser method to parse commandline options
initialize ( ) : void Overwrite shell initialize to dynamically load all Queue Related Tasks.
install ( ) : void Set up tables
main ( ) : void Output some basic usage Info.
reset ( ) : void Manually reset (failed) jobs for re-run.
runworker ( ) : void Run a QueueWorker loop.
settings ( ) : void Display current settings
stats ( ) : void Display some statistics about Finished Jobs.
uninstall ( ) : void Remove table and kill workers

Méthodes protégées

Méthode Description
_displayAvailableTasks ( ) : void
_exit ( integer $signal ) : void Signal handling to queue worker for clean shutdown
_getTaskConf ( ) : array Returns a List of available QueueTasks and their individual configurations.
_log ( string $type, integer | null $pid = null ) : void Timestamped log.
_logError ( string $message ) : void
_notify ( ) : void Timestamped notification.
_taskName ( string $task ) : string Output the task without Queue or Task example: QueueImageTask becomes Image on display

Method Details

__destruct() public méthode

Destructor, removes pid-file
public __destruct ( )

_displayAvailableTasks() protected méthode

protected _displayAvailableTasks ( ) : void
Résultat void

_exit() protected méthode

Signal handling to queue worker for clean shutdown
protected _exit ( integer $signal ) : void
$signal integer not used
Résultat void

_getTaskConf() protected méthode

Returns a List of available QueueTasks and their individual configurations.
protected _getTaskConf ( ) : array
Résultat array

_log() protected méthode

Timestamped log.
protected _log ( string $type, integer | null $pid = null ) : void
$type string Log type
$pid integer | null PID of the process
Résultat void

_logError() protected méthode

protected _logError ( string $message ) : void
$message string
Résultat void

_notify() protected méthode

Timestamped notification.
protected _notify ( ) : void
Résultat void

_taskName() protected méthode

Output the task without Queue or Task example: QueueImageTask becomes Image on display
protected _taskName ( string $task ) : string
$task string Task name
Résultat string Cleaned task name

add() public méthode

A QueueTask may provide an add function to enable the user to create new jobs via commandline.
public add ( ) : void
Résultat void

clean() public méthode

Manually trigger a Finished job cleanup.
public clean ( ) : void
Résultat void

getOptionParser() public méthode

Get option parser method to parse commandline options
public getOptionParser ( ) : Cake\Console\ConsoleOptionParser
Résultat Cake\Console\ConsoleOptionParser

initialize() public méthode

Overwrite shell initialize to dynamically load all Queue Related Tasks.
public initialize ( ) : void
Résultat void

install() public méthode

Set up tables
See also: readme
public install ( ) : void
Résultat void

main() public méthode

Output some basic usage Info.
public main ( ) : void
Résultat void

reset() public méthode

Careful, this should not be done while a queue task is being run.
public reset ( ) : void
Résultat void

runworker() public méthode

Runs a Queue Worker process which will try to find unassigned jobs in the queue which it may run and try to fetch and execute them.
public runworker ( ) : void
Résultat void

settings() public méthode

Display current settings
public settings ( ) : void
Résultat void

stats() public méthode

Display some statistics about Finished Jobs.
public stats ( ) : void
Résultat void

uninstall() public méthode

Remove table and kill workers
public uninstall ( ) : void
Résultat void

Property Details

$_exit protected_oe property

protected bool $_exit
Résultat boolean

$_taskConf protected_oe property

protected array $_taskConf
Résultat array

$modelClass public_oe property

public string $modelClass
Résultat string