Class: WithEvents::Aws::Topic
- Inherits:
-
Object
- Object
- WithEvents::Aws::Topic
- Defined in:
- lib/with_events/aws/topic.rb
Instance Method Summary collapse
-
#initialize(topic = nil) ⇒ Topic
constructor
A new instance of Topic.
- #publish(message) ⇒ Object
- #subscribe(options = {}, &block) ⇒ Object
Constructor Details
#initialize(topic = nil) ⇒ Topic
Returns a new instance of Topic.
27 28 29 |
# File 'lib/with_events/aws/topic.rb', line 27 def initialize(topic = nil) @topic = topic end |
Instance Method Details
#publish(message) ⇒ Object
31 32 33 |
# File 'lib/with_events/aws/topic.rb', line 31 def publish() Circuitry.publish(topic, .serialize) end |
#subscribe(options = {}, &block) ⇒ Object
35 36 37 38 39 |
# File 'lib/with_events/aws/topic.rb', line 35 def subscribe( = {}, &block) Circuitry.subscribe() do |, topic_name| skip_delete unless positive_result?(topic_name, , &block) end end |