src/Worker.php
public function receive(&$header)
    {
        $body = $this->relay->receiveSync($flags);

        if ($flags & Relay::PAYLOAD_CONTROL) {
            if ($this->handleControl($body, $header, $flags)) {
                // wait for the next command
                return $this->receive($header);
            }

            // no context for the termination.
            $header = null;

            // Expect process termination
            return null;
        }

        if ($flags & Relay::PAYLOAD_ERROR) {
            return new \Error($body);
        }

        return $body;
    }
public function receive(&$header)
    {
        $body = $this->relay->receiveSync($flags);

        if ($flags & Relay::PAYLOAD_CONTROL) {
            if ($this->handleControl($body, $header, $flags)) {
                // wait for the next command
                return $this->receive($header);
            }

            // no context for the termination.
            $header = null;

            // Expect process termination
            return null;
        }

        if ($flags & Relay::PAYLOAD_ERROR) {
            return new \Error($body);
        }

        return $body;
    }
public function receive ( & $ header ) { $ body = $ this -> relay -> receiveSync ( $ flags ) ; if ( $ flags & Relay :: PAYLOAD_CONTROL ) { if ( $ this -> handleControl ( $ body , $ header , $ flags ) ) { // wait for the next command return $ this -> receive ( $ header ) ; } // no context for the termination. $ header = null ; // Expect process termination return null ; } if ( $ flags & Relay :: PAYLOAD_ERROR ) { return new \ Error ( $ body ) ; } return $ body ; }
Receive packet of information to process, returns null when process must be stopped. Might
return Error to wrap error message from server.

@param mixed $header
@return \Error|null|string

@throws GoridgeException
Receive packet of information to process returns null when process must be stopped . Might return Error to wrap error message from server .