Module: Aikido::Zen::RailsEngine::LiveThreadContextSetter
- Defined in:
- lib/aikido/zen/rails_engine.rb
Overview
ActionController::Live runs the whole action in a new Thread so that the original thread can be freed to handle the next request once the response headers are committed.
Zen stores the current context on the current Fiber, and propagates this context to new Fibers created with Fiber.new. The root Fiber of a new Thread is not created with Fiber.new so the current context is not propagated automatically.
Propagate the current context to the root Fiber of the new Thread created by ActionController::Live to run the action.