module MultiJson::OptionsCache

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.

@api private

Constants

MAX_CACHE_SIZE

Maximum entries before oldest entry is evicted

Attributes

dump[R]

Get the dump options cache

@api private @return [Store] dump cache store

load[R]

Get the load options cache

@api private @return [Store] load cache store

Public Class Methods

reset() click to toggle source

Reset both caches

@api private @return [void]

# File lib/multi_json/options_cache.rb, line 90
def reset
  @dump = Store.new
  @load = Store.new
end