Class: Azure::ServiceBusService

Inherits:
Object
  • Object
show all
Defined in:
lib/azure-contrib/service_bus_service.rb

Instance Method Summary collapse

Instance Method Details

#find_or_create_subscription(topic, name) ⇒ Object

TODO: This needs to be moved to the contrib lib


12
13
14
15
16
17
# File 'lib/azure-contrib/service_bus_service.rb', line 12

def find_or_create_subscription(topic, name)
  subscription = self.list_subscriptions(topic.name).find {|subscription| subscription.name == name }
  subscription = self.create_subscription(topic.name, name) if subscription.nil?

  subscription
end

#find_or_create_topic(name) ⇒ Object

TODO: This needs to be moved to the contrib lib


4
5
6
7
8
9
# File 'lib/azure-contrib/service_bus_service.rb', line 4

def find_or_create_topic(name)
  topic = self.list_topics.find {|topic| topic.name == name }
  topic = self.create_topic(name) if topic.nil?

  topic
end