| @@ 334-369 (lines=36) @@ | ||
| 331 | * @param bool $nowait |
|
| 332 | * @return mixed|null |
|
| 333 | */ |
|
| 334 | public function exchange_declare( |
|
| 335 | $exchange, |
|
| 336 | $type, |
|
| 337 | $passive = false, |
|
| 338 | $durable = false, |
|
| 339 | $auto_delete = true, |
|
| 340 | $internal = false, |
|
| 341 | $nowait = false, |
|
| 342 | $arguments = null, |
|
| 343 | $ticket = null |
|
| 344 | ) { |
|
| 345 | $arguments = $this->getArguments($arguments); |
|
| 346 | $ticket = $this->getTicket($ticket); |
|
| 347 | ||
| 348 | list($class_id, $method_id, $args) = $this->protocolWriter->exchangeDeclare( |
|
| 349 | $ticket, |
|
| 350 | $exchange, |
|
| 351 | $type, |
|
| 352 | $passive, |
|
| 353 | $durable, |
|
| 354 | $auto_delete, |
|
| 355 | $internal, |
|
| 356 | $nowait, |
|
| 357 | $arguments |
|
| 358 | ); |
|
| 359 | ||
| 360 | $this->send_method_frame(array($class_id, $method_id), $args); |
|
| 361 | ||
| 362 | if ($nowait) { |
|
| 363 | return null; |
|
| 364 | } |
|
| 365 | ||
| 366 | return $this->wait(array( |
|
| 367 | $this->waitHelper->get_wait('exchange.declare_ok') |
|
| 368 | )); |
|
| 369 | } |
|
| 370 | ||
| 371 | /** |
|
| 372 | * Confirms an exchange declaration |
|
| @@ 598-631 (lines=34) @@ | ||
| 595 | * @param null $ticket |
|
| 596 | * @return mixed|null |
|
| 597 | */ |
|
| 598 | public function queue_declare( |
|
| 599 | $queue = '', |
|
| 600 | $passive = false, |
|
| 601 | $durable = false, |
|
| 602 | $exclusive = false, |
|
| 603 | $auto_delete = true, |
|
| 604 | $nowait = false, |
|
| 605 | $arguments = null, |
|
| 606 | $ticket = null |
|
| 607 | ) { |
|
| 608 | $arguments = $this->getArguments($arguments); |
|
| 609 | $ticket = $this->getTicket($ticket); |
|
| 610 | ||
| 611 | list($class_id, $method_id, $args) = $this->protocolWriter->queueDeclare( |
|
| 612 | $ticket, |
|
| 613 | $queue, |
|
| 614 | $passive, |
|
| 615 | $durable, |
|
| 616 | $exclusive, |
|
| 617 | $auto_delete, |
|
| 618 | $nowait, |
|
| 619 | $arguments |
|
| 620 | ); |
|
| 621 | ||
| 622 | $this->send_method_frame(array($class_id, $method_id), $args); |
|
| 623 | ||
| 624 | if ($nowait) { |
|
| 625 | return null; |
|
| 626 | } |
|
| 627 | ||
| 628 | return $this->wait(array( |
|
| 629 | $this->waitHelper->get_wait('queue.declare_ok') |
|
| 630 | )); |
|
| 631 | } |
|
| 632 | ||
| 633 | /** |
|
| 634 | * Confirms a queue definition |
|