Module: ActiveSupport::IsolatedExecutionState
- Defined in:
- lib/active_support/isolated_execution_state.rb
Overview
:nodoc:
Class Attribute Summary collapse
-
.isolation_level ⇒ Object
Returns the value of attribute isolation_level.
-
.scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Attribute Summary collapse
-
#active_support_execution_state ⇒ Object
Returns the value of attribute active_support_execution_state.
Class Method Summary collapse
- .[](key) ⇒ Object
- .[]=(key, value) ⇒ Object
- .clear ⇒ Object
- .context ⇒ Object
- .delete(key) ⇒ Object
- .key?(key) ⇒ Boolean
- .share_with(other) ⇒ Object
- .unique_id ⇒ Object
Class Attribute Details
.isolation_level ⇒ Object
Returns the value of attribute isolation_level.
12 13 14 |
# File 'lib/active_support/isolated_execution_state.rb', line 12 def isolation_level @isolation_level end |
.scope ⇒ Object (readonly)
Returns the value of attribute scope.
12 13 14 |
# File 'lib/active_support/isolated_execution_state.rb', line 12 def scope @scope end |
Instance Attribute Details
#active_support_execution_state ⇒ Object
Returns the value of attribute active_support_execution_state.
8 9 10 |
# File 'lib/active_support/isolated_execution_state.rb', line 8 def active_support_execution_state @active_support_execution_state end |
Class Method Details
.[](key) ⇒ Object
36 37 38 |
# File 'lib/active_support/isolated_execution_state.rb', line 36 def [](key) state[key] end |
.[]=(key, value) ⇒ Object
40 41 42 |
# File 'lib/active_support/isolated_execution_state.rb', line 40 def []=(key, value) state[key] = value end |
.clear ⇒ Object
52 53 54 |
# File 'lib/active_support/isolated_execution_state.rb', line 52 def clear state.clear end |
.context ⇒ Object
56 57 58 |
# File 'lib/active_support/isolated_execution_state.rb', line 56 def context scope.current end |
.delete(key) ⇒ Object
48 49 50 |
# File 'lib/active_support/isolated_execution_state.rb', line 48 def delete(key) state.delete(key) end |
.key?(key) ⇒ Boolean
44 45 46 |
# File 'lib/active_support/isolated_execution_state.rb', line 44 def key?(key) state.key?(key) end |
.share_with(other) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/active_support/isolated_execution_state.rb', line 60 def share_with(other) # Action Controller streaming spawns a new thread and copy thread locals. # We do the same here for backward compatibility, but this is very much a hack # and streaming should be rethought. context.active_support_execution_state = other.active_support_execution_state.dup end |