PHP Class Scalr\System\Zmq\Cron\Launcher

Since: 5.0.1 (15.09.2014)
Author: Vitaliy Demidov ([email protected])
Inheritance: use trait Scalr\LoggerAwareTrait
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( DateTime $start ) Constructor
ensureBrokerRunning ( ) : integer Makes sure the broker is running.
getAllTasks ( ) : Scalr\System\Zmq\Cron\ServiceIterator Gets the list of all tasks
getScheduled ( ) : Scalr\System\Zmq\Cron\ScheduledServiceIterator Gets the list of the tasks which are due to run
getStartBrokerCommand ( ) : string Gets start broker command
getStartClientCommand ( ) : string Gets start client command
getStartPhpScriptCommand ( string $script ) : string Gets start php script command
getStartWorkerCommand ( ) : string Gets start worker command
healthcheck ( ) Performs health chek
launch ( ) : integer Launches tasks are due to run
terminateBroker ( ) Terminates broker
terminateByFilter ( string $cmd, string $gracefully = true ) Gracefully terminates processes by start command key
terminateClients ( ) Terminates all clients

Method Details

__construct() public méthode

Constructor
public __construct ( DateTime $start )
$start DateTime Start time in system timezone

ensureBrokerRunning() public static méthode

If it isn't running method will start it.
public static ensureBrokerRunning ( ) : integer
Résultat integer Returns non false if broker is running

getAllTasks() public méthode

Gets the list of all tasks
public getAllTasks ( ) : Scalr\System\Zmq\Cron\ServiceIterator
Résultat Scalr\System\Zmq\Cron\ServiceIterator

getScheduled() public méthode

Gets the list of the tasks which are due to run
public getScheduled ( ) : Scalr\System\Zmq\Cron\ScheduledServiceIterator
Résultat Scalr\System\Zmq\Cron\ScheduledServiceIterator

getStartBrokerCommand() public static méthode

Gets start broker command
public static getStartBrokerCommand ( ) : string
Résultat string Returns start broker cmd

getStartClientCommand() public static méthode

Gets start client command
public static getStartClientCommand ( ) : string
Résultat string Returns start client cmd

getStartPhpScriptCommand() public static méthode

Gets start php script command
public static getStartPhpScriptCommand ( string $script ) : string
$script string relative path from app folder
Résultat string Returns start php script CMD

getStartWorkerCommand() public static méthode

Gets start worker command
public static getStartWorkerCommand ( ) : string
Résultat string Returns start worker cmd

healthcheck() public static méthode

Performs health chek
public static healthcheck ( )

launch() public méthode

Launches tasks are due to run
public launch ( ) : integer
Résultat integer Returns the number of the launched tasks

terminateBroker() public static méthode

Terminates broker
public static terminateBroker ( )

terminateByFilter() public static méthode

Gracefully terminates processes by start command key
public static terminateByFilter ( string $cmd, string $gracefully = true )
$cmd string CMD used as the start
$gracefully string optional Whether it should send SIGTERM rather than kill -9 forcefully

terminateClients() public static méthode

Terminates all clients
public static terminateClients ( )