Assigns FailCallback into GearmanTask

@param GearmanTask $gearmanTask Gearman Task

@see http://www.php.net/manual/en/gearmanclient.setfailcallback.php
436015
public function assignFailCallback(GearmanTask $gearmanTask)
    {
        $event = new GearmanClientCallbackFailEvent($gearmanTask);
        $this->eventDispatcher->dispatch(
            GearmanEvents::GEARMAN_CLIENT_CALLBACK_FAIL,
            $event
        );
    }
748423
protected static function prepareCallbackPrompter(
        CallbackPrompter $prompter,
        $noValidMessage,
        $attemptTimes,
        $failCloseMessage
    ) {
        $prompter->setAttemptTimes($attemptTimes);

        if ($noValidMessage !== null) {
            $prompter->setNoValidMessage($noValidMessage);
        }

        if ($failCloseMessage !== false) {
            $prompter->failToClose(true, $failCloseMessage);
        }

        return $prompter;
    }
596404
protected function initWorker($func, $cb = null) {
        try {
            $worker = new \GearmanWorker();
            $worker->setId($this->func . '@' . posix_getpid());
            $worker->setTimeout($this->timeout ? $this->timeout * 1000 : 5000);
            // Add Gearman Job Servers to Worker
            if (strpos($this->host, ',') > 0) {
                $connected = $worker->addServers($this->host);
            } else {
                $connected = $worker->addServer($this->host, $this->port);
            }
            if ($connected) {
                if (is_array($func)) {
                    foreach ($func as $f) {
                        $worker->addFunction($f[0], $f[1]);
                    }
                } else if (is_callable($cb)) {
                    $worker->addFunction($func, $cb);
                } else {
                    unset($worker);

                    return null;
                }

                return $worker;
            } else {
                log_error('Cannot connect to Gearmand Server: ' . $worker->error(), 'gearman.err');
            }
        } catch (\Exception $exception) {
            log_error($exception->getMessage(), 'gearman.err');
        }

        return null;
    }
198618
public function setFailConnectionFailed(bool $fail_connection_failed = true) : void
    {
        $this->is_connected = false;
        $this->fail_connection_failed = $fail_connection_failed;
    }
815617
public function setQuiet($bool)
    {
        $this->quiet = $bool;
        if ($this->quiet) {
            $this->failonerror = false;
        }
    }
1018451
public function setFailureFlag($failureFlag)
    {
        if (!in_array($failureFlag, array(self::FAIL_GRACEFULLY, self::FAIL_WITH_ERROR))) {
            throw new \InvalidArgumentException(
                'The failure flag of an SplClassLoader instance must be one of class "FAIL_" constants!'
            );
        }
        $this->_failureFlag = $failureFlag;
        return $this;
    }
1352009
public function fnUpdate(\GearmanJob $job)
    {
        $this->config->cleanup();

        /**
         * @var array $workload
         */
        $workload = JSON::decode($job->workload());

        foreach ($workload as $config)
        {
            $this->info('update config: ' . $config);

            \config([
                $config => $this->config
                    ->get($config)
                    ->asArray()
            ]);
        }
    }
1118668
public void setFailedScheduledUpdateGroupActions(java.util.Collection<FailedScheduledUpdateGroupActionRequest> failedScheduledUpdateGroupActions) {
        if (failedScheduledUpdateGroupActions == null) {
            this.failedScheduledUpdateGroupActions = null;
            return;
        }

        this.failedScheduledUpdateGroupActions = new com.amazonaws.internal.SdkInternalList<FailedScheduledUpdateGroupActionRequest>(
                failedScheduledUpdateGroupActions);
    }
1125148
public function setFallback($fallback = null)
    {
        if ($fallback === null) {
            $this->fallback = __DIR__.'/images/error.jpg';
        } else {
            $this->fallback = $fallback;
        }

        return $this;
    }
838904
function _on_fail(resp, man){
	// See if we got any traction.
	if( ! resp || ! resp.message_type() || ! resp.message() ){
	    // Something dark has happened, try to put something
	    // together.
	    // console.log('bad resp!?: ', resp);
	    var resp_seed = {
		'message_type': 'error',
		'message': 'deep manager error'
	    };
	    resp = new bbopx.barista.response(resp_seed);
	}
	anchor.apply_callbacks('manager_error', [resp, anchor]);
    }
414306
public function connect($timeout = 5.0)
    {
        if (true === $this->isConnected()) {
            return false;
        }

        $errorNumber = 0;
        $errorMessage = '';

        $this->connection = @fsockopen(
            $this->parameters['host'],
            $this->parameters['port'],
            $errorNumber,
            $errorMessage,
            $timeout
        );

        if (false === $this->isConnected()) {
            throw new GearmanConnectionException($errorMessage, $errorNumber);
        }

        return true;
    }
449932
public synchronized void notifyTaskFailure(long jobId, int taskId, String errorMessage) {
    Pair<Long, Integer> id = new Pair<>(jobId, taskId);
    TaskInfo.Builder taskInfo = mUnfinishedTasks.get(id);
    taskInfo.setStatus(Status.FAILED);
    taskInfo.setErrorMessage(errorMessage);
    finishTask(id);
    LOG.info("Task {} for job {} failed: {}", taskId, jobId, errorMessage);
  }
954172
public function setJsonCallbackWrap($callback)
    {

        if (empty($callback)) {
            $this->jsonCallbackWrap = false;
            return;
        }

        if (!is_string($callback)) {
            throw new \Exception('JSON callback wrap should be a string or false.');
        }

        $this->jsonCallbackWrap = $callback;
    }
1270997
public function pushReload(\GearmanJob $job)
    {
        $this->info(__FUNCTION__);
        $workload = $job->workload();

        $directoryIterator = new \RecursiveDirectoryIterator(
            app_path('Console/Commands'),
            \RecursiveDirectoryIterator::SKIP_DOTS
        );

        $iterator = new \RecursiveIteratorIterator($directoryIterator);

        /**
         * @var $file \SplFileInfo
         */
        foreach ($iterator as $file)
        {
            $namespace = \App\Console\Commands::class;
            $name = str_replace('.php', '', $file->getFilename());
            $class = $namespace . '\\' . $name;

            /**
             * @var WorkerCommand $object
             */
            $object = new $class;

            Gearman::client()->doBackground(
                $this->fnReload($object->getName()),
                $workload
            );

            $this->info('class: ' . $name . ', args: ' . $workload);
        }
    }
599967
public function setFailureCount($service, $failureCount)
    {
        $this->adapter->save($this->failureKey($service), $failureCount);
    }
952629
public function assignWarningCallback(GearmanTask $gearmanTask)
    {
        $event = new GearmanClientCallbackWarningEvent($gearmanTask);
        $this->eventDispatcher->dispatch(
            GearmanEvents::GEARMAN_CLIENT_CALLBACK_WARNING,
            $event
        );
    }
1348506
public function fail($exception = null)
    {
        if ($this->job) {
            FailingJob::handle($this->job->getConnectionName(), $this->job, $exception);
        }
    }