1 # -*- encoding: binary -*-
6 # Must be a positive Integer that is greater than :purge_keep
8 attr_accessor :purge_threshold
10 # Must be a positive Integer that is smaller than :purge_threshold
12 attr_accessor :purge_keep
14 class BadObjectError < RuntimeError; end
16 def initialize(klass, *args)
28 object = @klass.new(*@args)
29 @objects[object] = object
33 raise BadObjectError unless @objects.include? o
48 return if @queue.length < @purge_threshold
50 until @queue.length <= @purge_keep
53 obj.backend.shutdown if MogileFS::Client === obj