method
share_with
v8.1.1 -
Show latest stable
- Class:
ActiveSupport::IsolatedExecutionState
share_with(other, &block)public
No documentation available.
# File activesupport/lib/active_support/isolated_execution_state.rb, line 58
def share_with(other, &block)
# 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.
old_state, context.active_support_execution_state = context.active_support_execution_state, other.active_support_execution_state.dup
block.call
ensure
context.active_support_execution_state = old_state
end