Rpc/Promise.php
public function receive($timeout = null)
    {
        if (null == $this->message) {
            try {
                if ($message = $this->doReceive($this->receiveCallback, $this, $timeout)) {
                    $this->message = $message;
                }
            } finally {
                call_user_func($this->finallyCallback, $this);
            }
        }

        return $this->message;
    }
public function receive($timeout = null)
    {
        if (null == $this->message) {
            try {
                if ($message = $this->doReceive($this->receiveCallback, $this, $timeout)) {
                    $this->message = $message;
                }
            } finally {
                call_user_func($this->finallyCallback, $this);
            }
        }

        return $this->message;
    }
public function receive ( $ timeout = null ) { if ( null == $ this -> message ) { try { if ( $ message = $ this -> doReceive ( $ this -> receiveCallback , $ this , $ timeout ) ) { $ this -> message = $ message ; } } finally { call_user_func ( $ this -> finallyCallback , $ this ) ; } } return $ this -> message ; }
Blocks until message received or timeout expired.

@param int $timeout

@throws TimeoutException if the wait timeout is reached

@return InteropMessage
Blocks until message received or timeout expired .