lib/rainbows/base.rb in rainbows-0.7.0 vs lib/rainbows/base.rb in rainbows-0.8.0

- old
+ new

@@ -68,14 +68,14 @@ ensure client.close end def join_threads(threads) - expire = Time.now + (timeout * 2.0) - until threads.empty? || Time.now >= expire - threads.delete_if { |thr| thr.alive? ? thr.join(0.01) : true } - end - exit!(0) unless threads.empty? + G.quit! + threads.delete_if do |thr| + G.tick + thr.alive? ? thr.join(0.01) : true + end until threads.empty? end def self.included(klass) klass.const_set :LISTENERS, HttpServer::LISTENERS klass.const_set :G, Rainbows::G