class Pool

Attributes

running[RW]

Public Class Methods

new() click to toggle source
# File lib/gooddata_eloqua/helpers/pool.rb, line 5
def initialize
  @group = ThreadGroup.new
  @running = true
end

Public Instance Methods

active_threads() click to toggle source
# File lib/gooddata_eloqua/helpers/pool.rb, line 16
def active_threads
  @group.list.length
end
exit() click to toggle source
# File lib/gooddata_eloqua/helpers/pool.rb, line 24
def exit

  @group.pmap { |thread|
    thread.exit
  } unless @group.empty?

end
fork(&thread)
Alias for: thread
list() click to toggle source
# File lib/gooddata_eloqua/helpers/pool.rb, line 20
def list
  @group.list
end
thread(&thread) click to toggle source
# File lib/gooddata_eloqua/helpers/pool.rb, line 10
def thread(&thread)
  @group.add(Thread.new(&thread))
end
Also aliased as: fork