예제 #1
0
파일: Channel.php 프로젝트: swk/bluebox
 /**
  * reject an incoming message
  */
 public function basic_reject($delivery_tag, $requeue)
 {
     $args = new AMQP_Writer();
     $args->write_longlong($delivery_tag);
     $args->write_bit($requeue);
     $this->send_method_frame(array(60, 90), $args);
 }
예제 #2
0
파일: Connection.php 프로젝트: swk/bluebox
 public function send_content($channel, $class_id, $weight, $body_size, $packed_properties, $body)
 {
     $pkt = new AMQP_Writer();
     $pkt->write_octet(2);
     $pkt->write_short($channel);
     $pkt->write_long(strlen($packed_properties) + 12);
     $pkt->write_short($class_id);
     $pkt->write_short($weight);
     $pkt->write_longlong($body_size);
     $pkt->write($packed_properties);
     $pkt->write_octet(0xce);
     $pkt = $pkt->getvalue();
     $this->write($pkt);
     while ($body) {
         $payload = substr($body, 0, $this->frame_max - 8);
         $body = substr($body, $this->frame_max - 8);
         $pkt = new AMQP_Writer();
         $pkt->write_octet(3);
         $pkt->write_short($channel);
         $pkt->write_long(strlen($payload));
         $pkt->write($payload);
         $pkt->write_octet(0xce);
         $pkt = $pkt->getvalue();
         $this->write($pkt);
     }
 }