Phalcon\Queue\Beanstalk\Extended::getWatchingResponse PHP Метод

getWatchingResponse() защищенный метод

Added on 10-Jan-2014 20:04 IST by Tapan Kumar Thapa @ tapan.thapa@yahoo.com
protected getWatchingResponse ( string $cmd ) : string | null
$cmd string
Результат string | null
    protected function getWatchingResponse($cmd)
    {
        $result = null;
        $nbBytes = $this->write($cmd);
        if ($nbBytes && $nbBytes > 0) {
            $response = $this->read($nbBytes);
            $matches = [];
            if (!preg_match('#^WATCHING (\\d+).*?#', $response, $matches)) {
                throw new \RuntimeException(sprintf('Unhandled response: %s', $response));
            }
            $result = $response;
        }
        return $result;
    }