aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-04-16 10:28:47 +0200
committerJosé Valim <jose.valim@gmail.com>2011-04-16 10:28:47 +0200
commite30ca001efa861cc13259ca8287837174b24e679 (patch)
treeab47ef08d8c2e8773bb7fc6d6d24cda6cd32bf66 /actionpack/lib/action_view/template.rb
parent2dd43c3f804176d114cdbfeb8a0f92a43155baee (diff)
downloadrails-e30ca001efa861cc13259ca8287837174b24e679.tar.gz
rails-e30ca001efa861cc13259ca8287837174b24e679.tar.bz2
rails-e30ca001efa861cc13259ca8287837174b24e679.zip
Yo dawg, I heard you like streaming. So I put a fiber, inside a block, inside a body, so you can stream.
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r--actionpack/lib/action_view/template.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 17e549a1c2..6dfc4f68ae 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -126,6 +126,12 @@ module ActionView
@formats = Array.wrap(format).map { |f| f.is_a?(Mime::Type) ? f.ref : f }
end
+ # Returns if the underlying handler supports streaming. If so,
+ # a streaming buffer *may* be passed when it start rendering.
+ def supports_streaming?
+ handler.respond_to?(:supports_streaming?) && handler.supports_streaming?
+ end
+
# Render a template. If the template was not compiled yet, it is done
# exactly before rendering.
#