Class: OggEncode::SizedPsHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/autogg/utils.rb

Instance Method Summary collapse

Constructor Details

#initialize(max) ⇒ SizedPsHash

Returns a new instance of SizedPsHash.



18
19
20
21
# File 'lib/autogg/utils.rb', line 18

def initialize( max )
  @max = max
  super
end

Instance Method Details

#store(pid, path, &block) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/autogg/utils.rb', line 23

def store( pid, path, &block )
  while size >= @max
    pid = Process.wait
    delete( pid )
  end
  ps = block.call
  super( ps.pid, path )
end