Class: FootTraffic::ThreadPool
- Inherits:
-
Object
- Object
- FootTraffic::ThreadPool
- Defined in:
- lib/foot_traffic/session.rb
Instance Method Summary collapse
- #<<(thread) ⇒ Object
-
#initialize ⇒ ThreadPool
constructor
A new instance of ThreadPool.
- #wait ⇒ Object
Constructor Details
#initialize ⇒ ThreadPool
Returns a new instance of ThreadPool.
6 7 8 |
# File 'lib/foot_traffic/session.rb', line 6 def initialize @threads = [] end |
Instance Method Details
#<<(thread) ⇒ Object
10 11 12 |
# File 'lib/foot_traffic/session.rb', line 10 def <<(thread) @threads << thread end |
#wait ⇒ Object
14 15 16 |
# File 'lib/foot_traffic/session.rb', line 14 def wait @threads.map(&:join) end |