Class: Qup::Subscriber
Overview
Public: Receives Messages from a Topic
All Subscribers to a Topic will receive each Message that is published to the Topic.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Public: The name of this subscriber.
Instance Method Summary collapse
-
#initialize(topic, queue) ⇒ Subscriber
constructor
Public: Create a new Subscriber on a Topic.
-
#unsubscribe ⇒ Object
Public: Remove the Subscriber from the Topic.
Methods inherited from Consumer
Constructor Details
#initialize(topic, queue) ⇒ Subscriber
Public: Create a new Subscriber on a Topic
Returns a Subscriber
14 15 16 17 18 |
# File 'lib/qup/subscriber.rb', line 14 def initialize( topic, queue ) super( queue ) @topic = topic @name = @queue.name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Public: The name of this subscriber
9 10 11 |
# File 'lib/qup/subscriber.rb', line 9 def name @name end |
Instance Method Details
#unsubscribe ⇒ Object
Public: Remove the Subscriber from the Topic
This just means to destroy the Queue that it is attached to
24 25 26 |
# File 'lib/qup/subscriber.rb', line 24 def unsubscribe @queue.destroy end |