Mmoreram\GearmanBundle\Service\GearmanExecute::__construct PHP Method

__construct() public method

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
    public function __construct(GearmanCacheWrapper $gearmanCacheWrapper, array $defaultSettings)
    {
        parent::__construct($gearmanCacheWrapper, $defaultSettings);
        $this->executeOptionsResolver = new OptionsResolver();
        $this->executeOptionsResolver->setDefaults(array('iterations' => null, 'minimum_execution_time' => null, 'timeout' => null))->setAllowedTypes('iterations', array('null', 'scalar'))->setAllowedTypes('minimum_execution_time', array('null', 'scalar'))->setAllowedTypes('timeout', array('null', 'scalar'));
        $this->stopWorkSignalReceived = false;
        /**
         * If the pcntl_signal exists, subscribe to the terminate and restart events for graceful worker stops.
         */
        if (false !== function_exists('pcntl_signal')) {
            declare (ticks=1);
            pcntl_signal(SIGTERM, array($this, "handleSystemSignal"));
            pcntl_signal(SIGHUP, array($this, "handleSystemSignal"));
        }
    }