Methods
- B
- C
- D
- E
- I
- O
- R
- S
- T
- W
Included Modules
Attributes
| [RW] | error_latch | |
| [RW] | latch | |
| [RW] | tc |
Class Public methods
controller_path()
Link
Instance Public methods
bad_request_error()
Link
basic_stream()
Link
blocking_stream()
Link
default_header()
Link
exception_in_controller()
Link
exception_in_exception_callback()
Link
# File actionpack/test/controller/live_stream_test.rb, line 196 def exception_in_exception_callback response.headers['Content-Type'] = 'text/event-stream' response.stream.on_error do raise 'We need to go deeper.' end response.stream.write '' response.stream.write params[:widget][:didnt_check_for_nil] end
exception_in_view()
Link
exception_in_view_after_commit()
Link
exception_with_callback()
Link
# File actionpack/test/controller/live_stream_test.rb, line 176 def exception_with_callback response.headers['Content-Type'] = 'text/event-stream' response.stream.on_error do response.stream.write %Q(data: "500 Internal Server Error"\n\n) response.stream.close end response.stream.write "" # make sure the response is committed raise 'An exception occurred...' end
ignore_client_disconnect()
Link
# File actionpack/test/controller/live_stream_test.rb, line 230 def ignore_client_disconnect response.stream.ignore_disconnect = true response.stream.write '' # commit # These writes will be ignored 15.times do response.stream.write 'x' end logger.info 'Work complete' latch.count_down end
overfill_buffer_and_die()
Link
# File actionpack/test/controller/live_stream_test.rb, line 205 def overfill_buffer_and_die logger = ActionController::Base.logger || Logger.new($stdout) response.stream.on_error do logger.warn 'Error while streaming.' error_latch.count_down end # Write until the buffer is full. It doesn't expose that # information directly, so we must hard-code its size: 10.times do response.stream.write '.' end # .. plus one more, because the #each frees up a slot: response.stream.write '.' latch.count_down # This write will block, and eventually raise response.stream.write 'x' 20.times do response.stream.write '.' end end
render_text()
Link
thread_locals()
Link
# File actionpack/test/controller/live_stream_test.rb, line 153 def thread_locals tc.assert_equal 'aaron', Thread.current[:setting] response.headers['Content-Type'] = 'text/event-stream' %w{ hello world }.each do |word| response.stream.write word end response.stream.close end