# File lib/fluent/event_router.rb, line 111 def initialize super @map = {} @keys = [] end
# File lib/fluent/event_router.rb, line 117 def get(key) if collector = @map[key] return collector end collector = @map[key] = yield if @keys.size >= MATCH_CACHE_SIZE # expire the oldest key @map.delete @keys.shift end @keys << key collector end