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:



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

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)


672
673
674
# File 'lib/bunny/topology_registry.rb', line 672

def arguments
  @arguments
end

#callable#call (readonly)

Returns:

  • (#call)


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

def callable
  @callable
end

#consumer_tagString (readonly)

Returns:

  • (String)


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

def consumer_tag
  @consumer_tag
end

#exclusiveBoolean (readonly)

Returns:

  • (Boolean)


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

def exclusive
  @exclusive
end

#manual_ackBoolean (readonly)

Returns:

  • (Boolean)


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

def manual_ack
  @manual_ack
end

#queue_nameString (readonly)

Returns:

  • (String)


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

def queue_name
  @queue_name
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


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

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)


727
728
729
# File 'lib/bunny/topology_registry.rb', line 727

def eql?(other)
  self == other
end

#hashObject



743
744
745
# File 'lib/bunny/topology_registry.rb', line 743

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)


688
689
690
691
# File 'lib/bunny/topology_registry.rb', line 688

def update_queue_name_to(value)
  @queue_name = value
  self
end

#with_arguments(value) ⇒ Object

Parameters:

  • value (Hash)


722
723
724
725
# File 'lib/bunny/topology_registry.rb', line 722

def with_arguments(value)
  @arguments = value
  self
end

#with_callable(value) ⇒ Object

Parameters:

  • value (#call, Proc)


706
707
708
709
# File 'lib/bunny/topology_registry.rb', line 706

def with_callable(value)
  @callable = value
  self
end

#with_consumer_tag(value) ⇒ Object

Parameters:

  • value (String)


700
701
702
703
# File 'lib/bunny/topology_registry.rb', line 700

def with_consumer_tag(value)
  @consumer_tag = value
  self
end

#with_exclusive(value) ⇒ Object



716
717
718
719
# File 'lib/bunny/topology_registry.rb', line 716

def with_exclusive(value)
  @exclusive = value
  self
end

#with_manual_ack(value) ⇒ Object



711
712
713
714
# File 'lib/bunny/topology_registry.rb', line 711

def with_manual_ack(value)
  @manual_ack = value
  self
end

#with_queue_name(value) ⇒ Object

Parameters:

  • value (String)


694
695
696
697
# File 'lib/bunny/topology_registry.rb', line 694

def with_queue_name(value)
  @queue_name = value
  self
end