HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/gems/default/doc/actionpack-6.1.4.1/ri/ActionController/Live/cdesc-Live.ri
U:RDoc::NormalModule[iI"	Live:ETI"ActionController::Live;T0o:RDoc::Markup::Document:@parts[o;;[
o:RDoc::Markup::Paragraph;[I"NMix this module into your controller, and all actions in that controller ;TI"?will be able to stream data to the client as it's written.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim;[I"1class MyController < ActionController::Base
;TI"&  include ActionController::Live
;TI"
;TI"  def stream
;TI"@    response.headers['Content-Type'] = 'text/event-stream'
;TI"    100.times {
;TI"1      response.stream.write "hello world\n"
;TI"      sleep 1
;TI"    }
;TI"  ensure
;TI"    response.stream.close
;TI"  end
;TI"	end
;T:@format0o;	;[
I"TThere are a few caveats with this module. You *cannot* write headers after the ;TI"Kresponse has been committed (Response#committed? will return truthy). ;TI"OCalling +write+ or +close+ on the response stream will cause the response ;TI"Pobject to be committed. Make sure all headers are set before calling write ;TI"or close on your stream.;T@o;	;[I"NYou *must* call close on your stream when you're finished, otherwise the ;TI"%socket may be left open forever.;T@o;	;[I"RThe final caveat is that your actions are executed in a separate thread than ;TI"Qthe main thread. Make sure your actions are thread safe, and this shouldn't ;TI":be a problem (don't share state across threads, etc).;T:
@fileI"(lib/action_controller/metal/live.rb;T:0@omit_headings_from_table_of_contents_below0o;;[;
I"'lib/action_controller/test_case.rb;T;0;
0;0[[[[[I"
class;T[[:public[[:protected[[:private[[I"
instance;T[[;[[I"process;TI"(lib/action_controller/metal/live.rb;T[I"response_body=;T@I[;[[;[[I"log_error;T@I[[I"ActiveSupport::Concern;To;;[;
@1;0@I[U:RDoc::Context::Section[i0o;;[;
0;0[@1@4I"ActionController;TcRDoc::NormalModule