nosretep
2012-Mar-02 05:58 UTC
HTTP Streaming with Ruby on Rails running with JRuby (on Tomcat)
Is there any way to utilize Rails HTTP Streaming, the conventional way provided in Ruby on Rails 3.1, with JRuby (running in Tomcat)? I did not expect this to work, but I''ll post the error message anyway: NameError (uninitialized constant ActionView::StreamingTemplateRenderer::Fiber): /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_view/renderer/streaming_template_renderer.rb:71:in `delayed_render'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/activesupport-3.2.1/lib/active_support/notifications.rb:123:in `instrument'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/activesupport-3.2.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/activesupport-3.2.1/lib/active_support/notifications.rb:123:in `instrument'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_view/renderer/streaming_template_renderer.rb:70:in `delayed_render'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_view/renderer/streaming_template_renderer.rb:56:in `render_template'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_view/renderer/streaming_template_renderer.rb:23:in `call'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_view/renderer/streaming_template_renderer.rb:23:in `each'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/rack-1.4.1/lib/rack/chunked.rb:23:in `each'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_dispatch/http/response.rb:44:in `send'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/actionpack-3.2.1/lib/action_dispatch/http/response.rb:44:in `each'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/rack-1.4.1/lib/rack/body_proxy.rb:26:in `send'' /path/to/tomcat/webapps/ROOT/WEB-INF/gems/gems/rack-1.4.1/lib/rack/body_proxy.rb:26:in `method_missing'' file:/path/to/tomcat/webapps/ROOT/WEB-INF/lib/jruby-rack-1.1.4.jar!/jruby/rack/response.rb:103:in `send'' file:/path/to/tomcat/webapps/ROOT/WEB-INF/lib/jruby-rack-1.1.4.jar!/jruby/rack/response.rb:103:in `write_body'' file:/path/to/tomcat/webapps/ROOT/WEB-INF/lib/jruby-rack-1.1.4.jar!/jruby/rack/response.rb:50:in `respond'' my controller looks like: class ApplicationController < ActionController::Base def index render :stream => true end end Thanks in advance for any pointers. Thanks again! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/tj6aI9QGWRAJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
mkristian
2012-Mar-02 08:33 UTC
Re: HTTP Streaming with Ruby on Rails running with JRuby (on Tomcat)
this feature needs Fiber and that you have only with ruby 1.9.x, i.e. you need to use jruby in 1.9 mode. there is options setting in jruby- rack (or in warbler). -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nosretep
2012-Mar-02 08:48 UTC
Re: HTTP Streaming with Ruby on Rails running with JRuby (on Tomcat)
On Friday, March 2, 2012 3:33:40 AM UTC-5, mkristian wrote:> > this feature needs Fiber and that you have only with ruby 1.9.x, i.e. > you need to use jruby in 1.9 mode. there is options setting in jruby- > rack (or in warbler). >Yes, just found that. This now works. warble.rb: Warbler::Config.new do |config| # stuff before config.webxml.jruby.compat.version = "1.9" # stuff after end In addition to the content, It spits out some random numbers and letters as it streams, but I guess I''ll find the answer for that in due time too :) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/D-F-zZadxVEJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.