library/TaskDaemon/TaskDaemon.php
public function ping()
    {
        $options = static::getOptions();
        $debug = @$options['debug'] === true;

        $gmClient = new GearmanClient();
        $gmClient->addServer($options['gearman']['host'], $options['gearman']['port']);

        $ping = $gmClient->ping(self::generateUnique());

        if ($debug)
            echo "==> Pinging job server: " . ($ping ? 'Success' : 'Failure') . PHP_EOL;

        $code = $gmClient->returnCode();
        if ($code != GEARMAN_SUCCESS)
            throw new \Exception("Ping failed ($code)");

        return $ping;
    }
public function ping()
    {
        $options = static::getOptions();
        $debug = @$options['debug'] === true;

        $gmClient = new GearmanClient();
        $gmClient->addServer($options['gearman']['host'], $options['gearman']['port']);

        $ping = $gmClient->ping(self::generateUnique());

        if ($debug)
            echo "==> Pinging job server: " . ($ping ? 'Success' : 'Failure') . PHP_EOL;

        $code = $gmClient->returnCode();
        if ($code != GEARMAN_SUCCESS)
            throw new \Exception("Ping failed ($code)");

        return $ping;
    }
public function ping ( ) { $ options = static :: getOptions ( ) ; $ debug = @ $ options [ 'debug' ] === true ; $ gmClient = new GearmanClient ( ) ; $ gmClient -> addServer ( $ options [ 'gearman' ] [ 'host' ] , $ options [ 'gearman' ] [ 'port' ] ) ; $ ping = $ gmClient -> ping ( self :: generateUnique ( ) ) ; if ( $ debug ) echo "==> Pinging job server: " . ( $ ping ? 'Success' : 'Failure' ) . PHP_EOL ; $ code = $ gmClient -> returnCode ( ) ; if ( $ code != GEARMAN_SUCCESS ) throw new \ Exception ( "Ping failed ($code)" ) ; return $ ping ; }
Ping job servers

@return TaskDaemon
Ping job servers