PHP Класс Scalr\System\Zmq\Cron\AbstractTask

Task queue boilerplate.
С версии: 5.0.1 (10.09.2014)
Автор: Vitaliy Demidov ([email protected])
Наследование: implements Scalr\System\Zmq\Cron\TaskInterface, use trait Scalr\LoggerAwareTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$name string Task name
$queue ArrayObject Task queue

Открытые методы

Метод Описание
__construct ( ) Constructor
addWorker ( $address = null )
checkMemoryUsage ( )
config ( ) : object Gets config for this cron
getAuditLoggerConfig ( )
getName ( )
getReplicaAccounts ( ) : array Gets accounts to replicate a service to process its queue in the separate workers
getReplicaTypes ( string $name = 'type', string $regex = null ) : array Gets types to replicate a service to process its queue in the separate workers
getScalrService ( ) : ScalrService Gets Scalr service
isServiceRegistered ( string $serviceName = null ) : integer | boolean Checks whether service is registered with the broker
launch ( )
onCompleted ( )
onResponse ( Scalr\System\Zmq\Cron\AbstractPayload $payload )
run ( )
shutdown ( )

Защищенные методы

Метод Описание
launchClient ( ) : integer Runs ZMQ MDP Asynchronous Client
launchWorkers ( string $address = null ) : integer It launches pool of workers

Приватные методы

Метод Описание
_launchWorkers ( string $address = null, integer $workers = null ) : integer It launches pool of workers
terminateWorker ( integer $pid ) Terminates one worker by specified pid

Описание методов

__construct() публичный Метод

Constructor
public __construct ( )

addWorker() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::addWorker()
public addWorker ( $address = null )

checkMemoryUsage() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::checkMemoryUsage()
public checkMemoryUsage ( )

config() публичный Метод

Gets config for this cron
public config ( ) : object
Результат object Returns configuration options for the task

getAuditLoggerConfig() публичный Метод

См. также: Scalr\LogCollector\AuditLoggerRetrieveConfigurationInterface::getAuditLoggerConfig()

getName() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::getName()
public getName ( )

getReplicaAccounts() публичный Метод

Gets accounts to replicate a service to process its queue in the separate workers
public getReplicaAccounts ( ) : array
Результат array Returns the list of the accounts to replicate

getReplicaTypes() публичный Метод

Gets types to replicate a service to process its queue in the separate workers
public getReplicaTypes ( string $name = 'type', string $regex = null ) : array
$name string optional The name of the replica type in the config
$regex string optional Regex to validate. It should be specified without anchors and modifiers
Результат array Returns the list of the types to replicate

getScalrService() публичный Метод

Gets Scalr service
public getScalrService ( ) : ScalrService
Результат Scalr\Model\Entity\ScalrService Returns ScalrService instance for the current task

isServiceRegistered() публичный Метод

Checks whether service is registered with the broker
public isServiceRegistered ( string $serviceName = null ) : integer | boolean
$serviceName string optional The name of the service.
Результат integer | boolean Returns the number of registered workers if service has been registered with the broker or boolean FALSE otherwise

launch() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::launch()
public launch ( )

launchClient() защищенный Метод

Runs ZMQ MDP Asynchronous Client
protected launchClient ( ) : integer
Результат integer The number of launched workers

launchWorkers() защищенный Метод

It launches pool of workers
protected launchWorkers ( string $address = null ) : integer
$address string optional An address to override the service name
Результат integer The number of launched workers

onCompleted() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::onCompleted()
public onCompleted ( )

onResponse() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::onResponse()
public onResponse ( Scalr\System\Zmq\Cron\AbstractPayload $payload )
$payload Scalr\System\Zmq\Cron\AbstractPayload

run() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::run()
public run ( )

shutdown() публичный Метод

См. также: Scalr\System\Zmq\Cron\TaskInterface::shutdown()
public shutdown ( )

Описание свойств

$name защищенное свойство

Task name
protected string $name
Результат string

$queue защищенное свойство

Task queue
protected ArrayObject $queue
Результат ArrayObject