class Fluent::VariableStore

VariableStore provides all pluigns with the way to shared variable without using class variable it’s for safe reloading mechanism

Public Class Methods

fetch_or_build(namespace, default_value: {}) click to toggle source
# File lib/fluent/variable_store.rb, line 24
def fetch_or_build(namespace, default_value: {})
  @data[namespace] ||= default_value
end
try_to_reset() { || ... } click to toggle source
# File lib/fluent/variable_store.rb, line 28
def try_to_reset
  @data, old = {}, @data

  begin
    yield
  rescue
    @data = old
    raise
  end
end