Module: Lumberjack::ContextLocals
- Included in:
- Lumberjack
- Defined in:
- lib/lumberjack/context_locals.rb
Overview
Provides isolated fiber or thread local storage for thread-safe data access.
Defined Under Namespace
Classes: Data
Instance Method Summary collapse
-
#isolation_level ⇒ Symbol
Get the isolation level for context locals.
-
#isolation_level=(value) ⇒ void
Set the isolation level for context locals.
Instance Method Details
#isolation_level ⇒ Symbol
Get the isolation level for context locals.
32 33 34 |
# File 'lib/lumberjack/context_locals.rb', line 32 def isolation_level @isolation_level ||= :fiber end |
#isolation_level=(value) ⇒ void
This method returns an undefined value.
Set the isolation level for context locals.
23 24 25 26 27 |
# File 'lib/lumberjack/context_locals.rb', line 23 def isolation_level=(value) value = value&.to_sym value = :fiber unless [:fiber, :thread].include?(value) @isolation_level = value end |