class Populus::Pool

Public Class Methods

events() click to toggle source

TODO: Trying Enumerable#lazy

# File lib/populus/pool.rb, line 19
def events
  instance.objects.select {|o| o.type?('event') }
end
find_events_by_name(name) click to toggle source
# File lib/populus/pool.rb, line 23
def find_events_by_name(name)
  events.select{|o| o.has_name?(name) }
end
gen_threads() click to toggle source
# File lib/populus/pool.rb, line 27
def gen_threads
  instance.objects.map { |o|
    o.create_thread
  }
end
register_object(o) click to toggle source
# File lib/populus/pool.rb, line 13
def register_object(o)
  instance.objects << o
  Populus.logger.info "Registered: #{o.inspect}"
end

Public Instance Methods

objects() click to toggle source
# File lib/populus/pool.rb, line 8
def objects
  @objects ||= []
end