Class: Populus::Pool
Class Method Summary collapse
-
.events ⇒ Object
TODO: Trying Enumerable#lazy.
- .find_events_by_name(name) ⇒ Object
- .gen_threads ⇒ Object
- .register_object(o) ⇒ Object
Instance Method Summary collapse
Class Method Details
.events ⇒ Object
TODO: Trying Enumerable#lazy
19 20 21 |
# File 'lib/populus/pool.rb', line 19 def events instance.objects.select {|o| o.type?('event') } end |
.find_events_by_name(name) ⇒ Object
23 24 25 |
# File 'lib/populus/pool.rb', line 23 def find_events_by_name(name) events.select{|o| o.has_name?(name) } end |
.gen_threads ⇒ Object
27 28 29 30 31 |
# File 'lib/populus/pool.rb', line 27 def gen_threads instance.objects.map { |o| o.create_thread } end |
Instance Method Details
#objects ⇒ Object
8 9 10 |
# File 'lib/populus/pool.rb', line 8 def objects @objects ||= [] end |