Class: Groonga::MemoryPool Private
- Inherits:
-
Object
- Object
- Groonga::MemoryPool
- Defined in:
- lib/groonga/memory-pool.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #close ⇒ Object private
-
#initialize ⇒ MemoryPool
constructor
private
A new instance of MemoryPool.
- #register(object) ⇒ Object private
Constructor Details
#initialize ⇒ MemoryPool
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MemoryPool.
21 22 23 |
# File 'lib/groonga/memory-pool.rb', line 21 def initialize @temporary_objects = {} end |
Instance Method Details
#close ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 34 35 36 |
# File 'lib/groonga/memory-pool.rb', line 31 def close @temporary_objects.each do |(object, _)| object.close unless object.closed? end @temporary_objects.clear end |
#register(object) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 29 |
# File 'lib/groonga/memory-pool.rb', line 25 def register(object) return unless object.temporary? return unless object.is_a?(Groonga::Table) @temporary_objects[object] = true end |