method

share_with

Importance_0
v8.1.1 - Show latest stable - 0 notes - Class: IsolatedExecutionState
share_with(other, &block) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.