Class: Bunny::RecordedConsumer

Inherits:
RecordedEntity show all
Defined in:
lib/bunny/topology_registry.rb

Overview

Represents a consumer (subscription) registration intent that can be repeated.

Instance Attribute Summary collapse

Attributes inherited from RecordedEntity

#channel

Instance Method Summary collapse

Constructor Details

#initialize(ch, queue_name) ⇒ RecordedConsumer

Returns a new instance of RecordedConsumer.

Parameters:



674
675
676
677
678
679
680
681
682
683
# File 'lib/bunny/topology_registry.rb', line 674

def initialize(ch, queue_name)
  super ch

  @queue_name = queue_name
  @consumer_tag = nil
  @callable = nil
  @exclusive = false
  @manual_ack = true
  @arguments = Hash.new
end

Instance Attribute Details

#argumentsHash (readonly)

Returns:

  • (Hash)


670
671
672
# File 'lib/bunny/topology_registry.rb', line 670

def arguments
  @arguments
end

#callable#call (readonly)

Returns:

  • (#call)


666
667
668
# File 'lib/bunny/topology_registry.rb', line 666

def callable
  @callable
end

#consumer_tagString (readonly)

Returns:

  • (String)


664
665
666
# File 'lib/bunny/topology_registry.rb', line 664

def consumer_tag
  @consumer_tag
end

#exclusiveBoolean (readonly)

Returns:

  • (Boolean)


668
669
670
# File 'lib/bunny/topology_registry.rb', line 668

def exclusive
  @exclusive
end

#manual_ackBoolean (readonly)

Returns:

  • (Boolean)


668
669
670
# File 'lib/bunny/topology_registry.rb', line 668

def manual_ack
  @manual_ack
end

#queue_nameString (readonly)

Returns:

  • (String)


664
665
666
# File 'lib/bunny/topology_registry.rb', line 664

def queue_name
  @queue_name
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


731
732
733
734
735
736
737
738
739
# File 'lib/bunny/topology_registry.rb', line 731

def ==(other)
  other.class == self.class &&
    other.channel == self.channel &&
    other.queue_name == self.queue_name &&
    other.callable == self.callable &&
    other.manual_ack == self.manual_ack &&
    other.exclusive == self.exclusive &&
    other.arguments == self.arguments
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


725
726
727
# File 'lib/bunny/topology_registry.rb', line 725

def eql?(other)
  self == other
end

#hashObject



741
742
743
# File 'lib/bunny/topology_registry.rb', line 741

def hash
  [self.class, self.channel, @queue_name, @consumer_tag, @callable, @exclusive, @manual_ack, @arguments].hash
end

#update_queue_name_to(value) ⇒ Object

Parameters:

  • value (String)


686
687
688
689
# File 'lib/bunny/topology_registry.rb', line 686

def update_queue_name_to(value)
  @queue_name = value
  self
end

#with_arguments(value) ⇒ Object

Parameters:

  • value (Hash)


720
721
722
723
# File 'lib/bunny/topology_registry.rb', line 720

def with_arguments(value)
  @arguments = value
  self
end

#with_callable(value) ⇒ Object

Parameters:

  • value (#call, Proc)


704
705
706
707
# File 'lib/bunny/topology_registry.rb', line 704

def with_callable(value)
  @callable = value
  self
end

#with_consumer_tag(value) ⇒ Object

Parameters:

  • value (String)


698
699
700
701
# File 'lib/bunny/topology_registry.rb', line 698

def with_consumer_tag(value)
  @consumer_tag = value
  self
end

#with_exclusive(value) ⇒ Object



714
715
716
717
# File 'lib/bunny/topology_registry.rb', line 714

def with_exclusive(value)
  @exclusive = value
  self
end

#with_manual_ack(value) ⇒ Object



709
710
711
712
# File 'lib/bunny/topology_registry.rb', line 709

def with_manual_ack(value)
  @manual_ack = value
  self
end

#with_queue_name(value) ⇒ Object

Parameters:

  • value (String)


692
693
694
695
# File 'lib/bunny/topology_registry.rb', line 692

def with_queue_name(value)
  @queue_name = value
  self
end