Module: MultiJson::OptionsCache Private
- Defined in:
- lib/multi_json/options_cache.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Thread-safe LRU-like cache for merged options hashes
Caches are separated for load and dump operations. Each cache is bounded to prevent unbounded memory growth when options are generated dynamically.
Defined Under Namespace
Classes: Store
Constant Summary collapse
- MAX_CACHE_SIZE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Maximum entries before oldest entry is evicted
1000
Class Attribute Summary collapse
-
.dump ⇒ Store
readonly
private
Get the dump options cache.
-
.load ⇒ Store
readonly
private
Get the load options cache.
Class Method Summary collapse
-
.reset ⇒ void
private
Reset both caches.
Class Attribute Details
.dump ⇒ Store (readonly)
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.
Get the dump options cache
78 79 80 |
# File 'lib/multi_json/options_cache.rb', line 78 def dump @dump end |
.load ⇒ Store (readonly)
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.
Get the load options cache
84 85 86 |
# File 'lib/multi_json/options_cache.rb', line 84 def load @load end |
Class Method Details
.reset ⇒ void
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.
This method returns an undefined value.
Reset both caches
90 91 92 93 |
# File 'lib/multi_json/options_cache.rb', line 90 def reset @dump = Store.new @load = Store.new end |