public function setTitle($title)
    {
        if (getmypid() != $this->getPid()) {
            throw new ResqueRuntimeException(
                sprintf(
                    'Can not set title when process pid has changed. Expected "%s", got "%s"',
                    $this->getPid(),
                    getmypid()
                )
            );
        }

        // @todo, it is the workers domain to set this, move this logic back to the worker.
        $processTitle = 'resque-' . Resque::VERSION . ': ' . $title;

        if (function_exists('cli_set_process_title')) {
            // @todo remove @, it is throwing errors on my mac.
            @cli_set_process_title($processTitle);

            return;
        }

        if (function_exists('setproctitle')) {
            setproctitle($processTitle);
        }
    }