Property | Type | Description | |
---|---|---|---|
$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 |
Method | Description | |
---|---|---|
__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 ) : |
Set container | |
setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) : |
Set event dispatcher | |
setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) : |
Set output |
Method | Description | |
---|---|---|
addServers ( GearmanWorker $gmworker, array $servers ) : array | Adds into worker all defined Servers. | |
callJob ( array $worker, array $options = [], GearmanWorker $gearmanWorker = null ) : |
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 ) : |
Given a GearmanWorker and an instance of Job, run it |
public __construct ( Mmoreram\GearmanBundle\Service\GearmanCacheWrapper $gearmanCacheWrapper, array $defaultSettings ) | ||
$gearmanCacheWrapper | Mmoreram\GearmanBundle\Service\GearmanCacheWrapper | GearmanCacheWrapper |
$defaultSettings | array | The default settings for the bundle |
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 |
public executeWorker ( string $workerName, array $options = [] ) | ||
$workerName | string | Name of worker to be executed |
$options | array |
public handleSystemSignal ( $signo ) |
public setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container ) : |
||
$container | Symfony\Component\DependencyInjection\ContainerInterface | Container |
return | self Object |
public setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) : |
||
$eventDispatcher | Symfony\Component\EventDispatcher\EventDispatcherInterface | |
return | self Object |
public setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) : |
||
$output | Symfony\Component\Console\Output\OutputInterface | |
return | self Object |
protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher | ||
return | Symfony\Component\EventDispatcher\EventDispatcherInterface |
protected OptionsResolver,Symfony\Component\OptionsResolver $executeOptionsResolver | ||
return | Symfony\Component\OptionsResolver\OptionsResolver |
protected OutputInterface,Symfony\Component\Console\Output $output | ||
return | Symfony\Component\Console\Output\OutputInterface |
protected bool $stopWorkSignalReceived | ||
return | boolean |