class ActionView::StreamingFlow
:nodoc:
def append!(key, value)
by providing and resuming back to the fiber,
Appends the contents for the given key. This is called
def append!(key, value) super @fiber.resume if @waiting_for == key end
def get(key)
is not available and we're inside the layout fiber,
Try to get stored content. If the content
def get(key) return super if @content.key?(key) if inside_fiber? view = @view begin @waiting_for = key view.output_buffer, @parent = @child, view.output_buffer Fiber.yield ensure @waiting_for = nil view.output_buffer, @child = @parent, view.output_buffer end end super end
def initialize(view, fiber)
def initialize(view, fiber) @view = view @parent = nil @child = view.output_buffer @content = view.view_flow.content @fiber = fiber @root = Fiber.current.object_id end
def inside_fiber?
def inside_fiber? Fiber.current.object_id != @root end