Hi,everyone.Here''s my situation: I have a controller like this: class FooController < ApplicationController def delay sleep 10 render :text=>"ok" end def normal render :text=>"ok" end end but I found that "sleep 10" will not only make the current request delay 10 seconds,but also make the whole server sleep 10 seconds. That means if I request "/foo/delay"and "/foo/normal" sequently on my Browser,they both response after 10 seconds.But I only want the first request delay 10 seconds while the others can normally work. any Idea? thanks in advance --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This is because mongrel and Webrick will only serve one request at a time. On Tue, May 27, 2008 at 4:17 PM, fanz <winstar001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi,everyone.Here''s my situation: > I have a controller like this: > class FooController < ApplicationController > def delay > sleep 10 > render :text=>"ok" > end > > def normal > render :text=>"ok" > end > end > > but I found that "sleep 10" will not only make the current request > delay 10 seconds,but also make the whole server sleep 10 seconds. That > means if I request "/foo/delay"and "/foo/normal" sequently on my > Browser,they both response after 10 seconds.But I only want the first > request delay 10 seconds while the others can normally work. > any Idea? thanks in advance > > > >-- Appreciated my help? Recommend me on Working With Rails http://workingwithrails.com/person/11030-ryan-bigg --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> This is because mongrel and Webrick will only serve one request at a time.Yes. And to be more specific: you have to use Mongrel cluster (do ''sudo gem install mongrel_cluster'' and see http://www.google.com/search?q=mongrel_rails+howto) for being able to serve more than one request simultaneously in development. Karel --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On May 26, 2008, at 11:54 PM, Ryan Bigg (Radar) wrote:> This is because mongrel and Webrick will only serve one request at a > time.Actually this is because *rails* can only serve one request at a time as it is single threaded. Other frameworks and apps that run on mongrel or webrick have no problems serving concurrent requests. Cheers- - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra-NLltGlunAUd/unjJdyJNww@public.gmane.org -- EngineYard.com --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I have to say the "deferred" feature in merb is pretty darn cool. Basically make any process run in the background by just wrapping it in a deferred block. I can''t wait for Rails on Rack to be finished though. It is a major step in the right direction. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, May 28, 2008 at 11:00 AM, Ezra Zygmuntowicz <ezmobius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Actually this is because *rails* can only serve one request at a time > as it is single threaded. Other frameworks and apps that run on > mongrel or webrick have no problems serving concurrent requests. > > Cheers- > - Ezra Zygmuntowicz > -- Founder & Software Architect > -- ezra-NLltGlunAUd/unjJdyJNww@public.gmane.org > -- EngineYard.com > >Whoops! Thanks for that Ezra. -- Appreciated my help? Recommend me on Working With Rails http://workingwithrails.com/person/11030-ryan-bigg --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---