Example #1
0
 public function nack_fails_without_connection()
 {
     $m = new ReceivedMessage();
     $m->nack();
 }
Example #2
0
 /**
  * Receive a message
  *
  * @param   double timeout default 0.2 pass null for no timeout
  * @return  peer.stomp.frame.Frame
  */
 public function receive($timeout = 0.2)
 {
     $frame = $this->recvFrame($timeout);
     if ($frame instanceof ErrorFrame) {
         throw (new Exception($frame->getMessage()))->withFrame($frame);
     }
     if ($frame instanceof MessageFrame) {
         $msg = new ReceivedMessage();
         $msg->withFrame($frame, $this);
         return $msg;
     }
     return $frame;
 }