Class: Rmega::Pool
- Inherits:
-
Object
- Object
- Rmega::Pool
- Defined in:
- lib/rmega/pool.rb
Constant Summary collapse
- MAX =
4
Instance Method Summary collapse
- #defer(&block) ⇒ Object
-
#initialize(max = MAX) ⇒ Pool
constructor
A new instance of Pool.
- #wait_done ⇒ Object
Constructor Details
Instance Method Details
#defer(&block) ⇒ Object
18 19 20 21 |
# File 'lib/rmega/pool.rb', line 18 def defer(&block) synchronize { @queue << block } process_queue end |
#wait_done ⇒ Object
23 24 25 |
# File 'lib/rmega/pool.rb', line 23 def wait_done synchronize { @resource.wait(@mutex) } end |