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.
562 563 564 565 566 567 568 569 570 |
# File 'lib/bunny/topology_registry.rb', line 562 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)
558 559 560 |
# File 'lib/bunny/topology_registry.rb', line 558 def arguments @arguments end |
#auto_delete ⇒ Boolean (readonly)
556 557 558 |
# File 'lib/bunny/topology_registry.rb', line 556 def auto_delete @auto_delete end |
#durable ⇒ Boolean (readonly)
556 557 558 |
# File 'lib/bunny/topology_registry.rb', line 556 def durable @durable end |
#exclusive ⇒ Boolean (readonly)
556 557 558 |
# File 'lib/bunny/topology_registry.rb', line 556 def exclusive @exclusive end |
Class Method Details
.from(q) ⇒ Object
651 652 653 654 655 656 657 658 |
# File 'lib/bunny/topology_registry.rb', line 651 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
636 637 638 639 640 641 642 643 644 |
# File 'lib/bunny/topology_registry.rb', line 636 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
590 591 592 |
# File 'lib/bunny/topology_registry.rb', line 590 def auto_delete? @auto_delete end |
#eql?(other) ⇒ Boolean
631 632 633 |
# File 'lib/bunny/topology_registry.rb', line 631 def eql?(other) self == other end |
#exclusive? ⇒ Boolean
600 601 602 |
# File 'lib/bunny/topology_registry.rb', line 600 def exclusive? @exclusive end |
#hash ⇒ Object
646 647 648 |
# File 'lib/bunny/topology_registry.rb', line 646 def hash [self.class, self.channel, @name, @durable].hash end |
#name_to_use_for_recovery ⇒ String
622 623 624 625 626 627 628 |
# File 'lib/bunny/topology_registry.rb', line 622 def name_to_use_for_recovery if server_named? EMPTY_STRING else self.name end end |
#server_named? ⇒ Boolean
611 612 613 |
# File 'lib/bunny/topology_registry.rb', line 611 def server_named? !!@server_named end |
#update_name_to(value) ⇒ Object
573 574 575 576 |
# File 'lib/bunny/topology_registry.rb', line 573 def update_name_to(value) @name = value self end |
#with_arguments(value) ⇒ Object
616 617 618 619 |
# File 'lib/bunny/topology_registry.rb', line 616 def with_arguments(value) @arguments = value self end |
#with_auto_delete(value) ⇒ Object
585 586 587 588 |
# File 'lib/bunny/topology_registry.rb', line 585 def with_auto_delete(value) @auto_delete = value self end |
#with_durable(value) ⇒ Object
579 580 581 582 |
# File 'lib/bunny/topology_registry.rb', line 579 def with_durable(value) @durable = value self end |
#with_exclusive(value) ⇒ Object
595 596 597 598 |
# File 'lib/bunny/topology_registry.rb', line 595 def with_exclusive(value) @exclusive = value self end |
#with_server_named(value) ⇒ Object
605 606 607 608 |
# File 'lib/bunny/topology_registry.rb', line 605 def with_server_named(value) @server_named = value self end |