Class: Bunny::RecordedQueue
- Inherits:
-
RecordedNamedEntity
- Object
- RecordedEntity
- RecordedNamedEntity
- Bunny::RecordedQueue
- Defined in:
- lib/bunny/topology_registry.rb
Overview
Represents an exchange declaration intent that can be repeated.
Server-named queues will acquire a new server-generated name.
Constant Summary collapse
- EMPTY_STRING =
"".freeze
Instance Attribute Summary collapse
- #arguments ⇒ Hash readonly
- #auto_delete ⇒ Boolean readonly
- #durable ⇒ Boolean readonly
- #exclusive ⇒ Boolean readonly
Attributes inherited from RecordedNamedEntity
Attributes inherited from RecordedEntity
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Boolean
- #auto_delete? ⇒ Boolean
- #eql?(other) ⇒ Boolean
- #exclusive? ⇒ Boolean
- #hash ⇒ Object
-
#initialize(ch, name) ⇒ RecordedQueue
constructor
A new instance of RecordedQueue.
- #name_to_use_for_recovery ⇒ String
- #server_named? ⇒ Boolean
- #update_name_to(value) ⇒ Object
- #with_arguments(value) ⇒ Object
- #with_auto_delete(value) ⇒ Object
- #with_durable(value) ⇒ Object
- #with_exclusive(value) ⇒ Object
- #with_server_named(value) ⇒ Object
Constructor Details
#initialize(ch, name) ⇒ RecordedQueue
Returns a new instance of RecordedQueue.
564 565 566 567 568 569 570 571 572 |
# File 'lib/bunny/topology_registry.rb', line 564 def initialize(ch, name) super ch, name @durable = true @auto_delete = false @exclusive = false @server_named = false @arguments = nil end |
Instance Attribute Details
#arguments ⇒ Hash (readonly)
560 561 562 |
# File 'lib/bunny/topology_registry.rb', line 560 def arguments @arguments end |
#auto_delete ⇒ Boolean (readonly)
558 559 560 |
# File 'lib/bunny/topology_registry.rb', line 558 def auto_delete @auto_delete end |
#durable ⇒ Boolean (readonly)
558 559 560 |
# File 'lib/bunny/topology_registry.rb', line 558 def durable @durable end |
#exclusive ⇒ Boolean (readonly)
558 559 560 |
# File 'lib/bunny/topology_registry.rb', line 558 def exclusive @exclusive end |
Class Method Details
.from(q) ⇒ Object
653 654 655 656 657 658 659 660 |
# File 'lib/bunny/topology_registry.rb', line 653 def self.from(q) new(q.channel, q.name) .with_server_named(q.server_named?) .with_durable(q.durable?) .with_auto_delete(q.auto_delete?) .with_exclusive(q.exclusive?) .with_arguments(q.arguments) end |
Instance Method Details
#==(other) ⇒ Boolean
638 639 640 641 642 643 644 645 646 |
# File 'lib/bunny/topology_registry.rb', line 638 def ==(other) other.class == self.class && other.name == self.name && other.channel == self.channel && other.durable == self.durable && other.auto_delete == self.auto_delete && other.exclusive == self.exclusive && other.arguments == self.arguments end |
#auto_delete? ⇒ Boolean
592 593 594 |
# File 'lib/bunny/topology_registry.rb', line 592 def auto_delete? @auto_delete end |
#eql?(other) ⇒ Boolean
633 634 635 |
# File 'lib/bunny/topology_registry.rb', line 633 def eql?(other) self == other end |
#exclusive? ⇒ Boolean
602 603 604 |
# File 'lib/bunny/topology_registry.rb', line 602 def exclusive? @exclusive end |
#hash ⇒ Object
648 649 650 |
# File 'lib/bunny/topology_registry.rb', line 648 def hash [self.class, self.channel, @name, @durable].hash end |
#name_to_use_for_recovery ⇒ String
624 625 626 627 628 629 630 |
# File 'lib/bunny/topology_registry.rb', line 624 def name_to_use_for_recovery if server_named? EMPTY_STRING else self.name end end |
#server_named? ⇒ Boolean
613 614 615 |
# File 'lib/bunny/topology_registry.rb', line 613 def server_named? !!@server_named end |
#update_name_to(value) ⇒ Object
575 576 577 578 |
# File 'lib/bunny/topology_registry.rb', line 575 def update_name_to(value) @name = value self end |
#with_arguments(value) ⇒ Object
618 619 620 621 |
# File 'lib/bunny/topology_registry.rb', line 618 def with_arguments(value) @arguments = value self end |
#with_auto_delete(value) ⇒ Object
587 588 589 590 |
# File 'lib/bunny/topology_registry.rb', line 587 def with_auto_delete(value) @auto_delete = value self end |
#with_durable(value) ⇒ Object
581 582 583 584 |
# File 'lib/bunny/topology_registry.rb', line 581 def with_durable(value) @durable = value self end |
#with_exclusive(value) ⇒ Object
597 598 599 600 |
# File 'lib/bunny/topology_registry.rb', line 597 def with_exclusive(value) @exclusive = value self end |
#with_server_named(value) ⇒ Object
607 608 609 610 |
# File 'lib/bunny/topology_registry.rb', line 607 def with_server_named(value) @server_named = value self end |