PHP 클래스 Mmoreram\GearmanBundle\Service\GearmanExecute

부터: 2.3.1
상속: extends Mmoreram\GearmanBundle\Service\Abstracts\AbstractGearmanService
파일 보기 프로젝트 열기: mmoreram/gearman-bundle 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface EventDispatcher instance
$executeOptionsResolver Symfony\Component\OptionsResolver\OptionsResolver
$output Symfony\Component\Console\Output\OutputInterface Output instance
$stopWorkSignalReceived boolean Boolean to track if a system signal has been received

공개 메소드들

메소드 설명
__construct ( Mmoreram\GearmanBundle\Service\GearmanCacheWrapper $gearmanCacheWrapper, array $defaultSettings ) Construct method
executeJob ( string $jobName, array $options = [], GearmanWorker $gearmanWorker = null ) Executes a job given a jobName and given settings and annotations of job
executeWorker ( string $workerName, array $options = [] ) Executes a worker given a workerName subscribing all his jobs inside and given settings and annotations of worker and jobs
handleJob ( GearmanJob $job, mixed $context ) : mixed Wrapper function handler for all registered functions This allows us to do some nice logging when jobs are started/finished
handleSystemSignal ( $signo ) Toggles that work should be stopped, we only subscribe to SIGTERM and SIGHUP
setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container ) : GearmanExecute Set container
setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) : GearmanExecute Set event dispatcher
setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) : GearmanExecute Set output

비공개 메소드들

메소드 설명
addServers ( GearmanWorker $gmworker, array $servers ) : array Adds into worker all defined Servers.
callJob ( array $worker, array $options = [], GearmanWorker $gearmanWorker = null ) : GearmanExecute Given a worker, execute GearmanWorker function defined by job.
createJob ( array $worker ) : Object Given a worker settings, return Job instance
runJob ( GearmanWorker $gearmanWorker, Object $objInstance, array $jobs, integer $iterations, integer $timeout = null ) : GearmanExecute Given a GearmanWorker and an instance of Job, run it

메소드 상세

__construct() 공개 메소드

Construct method
public __construct ( Mmoreram\GearmanBundle\Service\GearmanCacheWrapper $gearmanCacheWrapper, array $defaultSettings )
$gearmanCacheWrapper Mmoreram\GearmanBundle\Service\GearmanCacheWrapper GearmanCacheWrapper
$defaultSettings array The default settings for the bundle

executeJob() 공개 메소드

Executes a job given a jobName and given settings and annotations of job
public executeJob ( string $jobName, array $options = [], GearmanWorker $gearmanWorker = null )
$jobName string Name of job to be executed
$options array Array of options passed to the callback
$gearmanWorker GearmanWorker Worker instance to use

executeWorker() 공개 메소드

Executes a worker given a workerName subscribing all his jobs inside and given settings and annotations of worker and jobs
public executeWorker ( string $workerName, array $options = [] )
$workerName string Name of worker to be executed
$options array

handleJob() 공개 메소드

Wrapper function handler for all registered functions This allows us to do some nice logging when jobs are started/finished
또한 보기: https://github.com/brianlmoon/GearmanManager/blob/ffc828dac2547aff76cb4962bb3fcc4f454ec8a2/GearmanPeclManager.php#L95-206
public handleJob ( GearmanJob $job, mixed $context ) : mixed
$job GearmanJob
$context mixed
리턴 mixed

handleSystemSignal() 공개 메소드

Toggles that work should be stopped, we only subscribe to SIGTERM and SIGHUP
public handleSystemSignal ( $signo )

setContainer() 공개 메소드

Set container
public setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container ) : GearmanExecute
$container Symfony\Component\DependencyInjection\ContainerInterface Container
리턴 GearmanExecute self Object

setEventDispatcher() 공개 메소드

Set event dispatcher
public setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) : GearmanExecute
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
리턴 GearmanExecute self Object

setOutput() 공개 메소드

Set output
public setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) : GearmanExecute
$output Symfony\Component\Console\Output\OutputInterface
리턴 GearmanExecute self Object

프로퍼티 상세

$eventDispatcher 보호되어 있는 프로퍼티

EventDispatcher instance
protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher
리턴 Symfony\Component\EventDispatcher\EventDispatcherInterface

$executeOptionsResolver 보호되어 있는 프로퍼티

protected OptionsResolver,Symfony\Component\OptionsResolver $executeOptionsResolver
리턴 Symfony\Component\OptionsResolver\OptionsResolver

$output 보호되어 있는 프로퍼티

Output instance
protected OutputInterface,Symfony\Component\Console\Output $output
리턴 Symfony\Component\Console\Output\OutputInterface

$stopWorkSignalReceived 보호되어 있는 프로퍼티

Boolean to track if a system signal has been received
protected bool $stopWorkSignalReceived
리턴 boolean