<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -121,12 +121,14 @@ module ReframeIt
       # +queue_name+ - the name of the aws queue we wish to listen on
       # +subscribe_interval+ - how often we should send a subscription message
       #
-      # Returns: (running) subscription thread
+      # Returns: (running) subscription thread or nil if none was needed
       #
       # TODO: provide a way to stop the subscription thread
       # FIXME: we just leave the listener thread dangling here
       ##
       def subscribe(subscribes = [], queue_name = nil, subscribe_interval=10)
+        return nil if subscribes.empty?
+
         # start listening on our queue
         queue = sqs.queue(queue_name)
         listener = QueueListener.new(queue)
@@ -235,7 +237,8 @@ module ReframeIt
         run_post_scripts
 
         # keep listening...
-        listener_thread.join
+        listener_thread.join if listener_thread
+        avail_thread.join if avail_thread
       end
 
       ##</diff>
      <filename>lib/ec2-discovery.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@ describe ReframeIt::EC2::UpdateHosts do
     discovery2.should_receive(:public_name).and_return('discovery2_public')
     
     discovery2.actions.first.class.should == ReframeIt::EC2::UpdateHosts
-    discovery2.actions.first.should_receive(:invoke).at_least(:once)
+    discovery2.actions.first.should_receive(:invoke).at_least(:once).and_return(nil)
     
     thread1 = Thread.new do
       discovery1.run</diff>
      <filename>spec/action_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -115,7 +115,7 @@ describe ReframeIt::EC2::Discovery do
       msg = ReframeIt::EC2::SubscriptionMessage.new(['service1'], 'response_queue1', true)
       @discovery.send_message(@discovery.monitor_queue, msg)
       @discovery.monitor_queue.size.should == 1
-      sleep 1
+      sleep 5
       @discovery.monitor_queue.size.should == 0
     end
 </diff>
      <filename>spec/ec2-discovery_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>978d95870531cdc1c3027ddc9b9bb55d14ddb158</id>
    </parent>
  </parents>
  <author>
    <name>Ben Taitelbaum</name>
    <email>ben@reframeit.com</email>
  </author>
  <url>http://github.com/reframeit/ec2-discovery/commit/ba5d4cb6966011316e9a33c16ab2d9eacb715bd9</url>
  <id>ba5d4cb6966011316e9a33c16ab2d9eacb715bd9</id>
  <committed-date>2009-04-01T11:31:16-07:00</committed-date>
  <authored-date>2009-04-01T11:31:16-07:00</authored-date>
  <message>minor tweaks

tweaked a couple tests to pass,
don't bother sending subscription messages if you're not subscribing to anything</message>
  <tree>ff70c644dee93d4f7f40da04bf12bf9b2306aafc</tree>
  <committer>
    <name>Ben Taitelbaum</name>
    <email>ben@reframeit.com</email>
  </committer>
</commit>
