class SoarSr::ThreadedHandler

Attributes

max_threads[RW]

Public Class Methods

new(urns, uddi, credentials, registry, max_threads = 15) click to toggle source
Calls superclass method SoarSr::Handler::new
# File lib/soar_sr/threaded_handler.rb, line 6
def initialize(urns, uddi, credentials, registry, max_threads = 15)
  super(urns, uddi, credentials, registry)
  @@mutex = Mutex.new
  @max_threads = max_threads
end

Protected Instance Methods

join_on_max_threads(threads) click to toggle source
# File lib/soar_sr/threaded_handler.rb, line 20
def join_on_max_threads(threads)
  if threads.count == @max_threads
    join_threads(threads)
    threads = []
  end
  threads
end
join_threads(threads) click to toggle source
# File lib/soar_sr/threaded_handler.rb, line 14
def join_threads(threads)
  threads.each do |t|
    t.join
  end
end