class Azure::ServiceBusService

Public Instance Methods

find_or_create_subscription(topic, name) click to toggle source

TODO: This needs to be moved to the contrib lib

# 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) click to toggle source

TODO: This needs to be moved to the contrib lib

# 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