Hi all I am working on a heavy engineering project. And the requirement is that I needto do a lot of process before I store the data to the db. Now the question is that I want to do the process that I am doing but I want to do it in the background. What I actually mean to say is that..I just want the user to get a msg that Records Saved. But in real I want the process to go on in background. There r multiple callbacks used in my system. Also I dont want to use Starling or workling. pls suggest something where in my requirement is satisfied. Since i dont want the user to wait until my process is going on. thanks -- 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 23 Feb 2009, at 10:38, Ankit Parekh wrote:> > Hi all > > I am working on a heavy engineering project. And the requirement is > that > I needto do a lot of process before I store the data to the db. > > Now the question is that I want to do the process that I am doing > but I > want to do it in the background. What I actually mean to say is > that..I > just want the user to get a msg that Records Saved. But in real I want > the process to go on in background. > > There r multiple callbacks used in my system. Also I dont want to use > Starling or workling. pls suggest something where in my requirement is > satisfied. Since i dont want the user to wait until my process is > going > on. >Well one of the other background processors (bj, backgroundrb etc. ) might do the job Fred> thanks > -- > 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 -~----------~----~----~----~------~----~------~--~---
Spawn is dead easy (http://rubyforge.org/projects/spawn/). I used it to great effect for sending emails while making the user think they where all already sent. The others Frederick suggested work but are more trouble than starling/workling. Harm On Feb 23, 12:14 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 23 Feb 2009, at 10:38, Ankit Parekh wrote: > > > > > > > Hi all > > > I am working on a heavy engineering project. And the requirement is > > that > > I needto do a lot of process before I store the data to the db. > > > Now the question is that I want to do the process that I am doing > > but I > > want to do it in the background. What I actually mean to say is > > that..I > > just want the user to get a msg that Records Saved. But in real I want > > the process to go on in background. > > > There r multiple callbacks used in my system. Also I dont want to use > > Starling or workling. pls suggest something where in my requirement is > > satisfied. Since i dont want the user to wait until my process is > > going > > on. > > Well one of the other background processors (bj, backgroundrb etc. ) > might do the job > > Fred > > > thanks > > -- > > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks for your reply but i dont want to run something like a cron job or nething. Since my method is very long i want it to run in background. So that the user dont need to wait on that page while the process is going on. Is there something where i can define that a particular method should run in background. Thanks -- 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 23 Feb 2009, at 11:44, Ankit Parekh wrote:> > thanks for your reply but i dont want to run something like a cron job > or nething. > > Since my method is very long i want it to run in background. So that > the > user dont need to wait on that page while the process is going on. > > Is there something where i can define that a particular method should > run in background. >The way you do that reliably is to spawn another process to handle it. You can do your thing in a thread but that pretty much requires that you''re using a thread safe version of rails and has limitations given ruby''s threading (eg your thread can block the whole mongrel) Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ankit Parekh wrote:> thanks for your reply but i dont want to run something like a cron job > or nething. > > Since my method is very long i want it to run in background. So that the > user dont need to wait on that page while the process is going on. > > Is there something where i can define that a particular method should > run in background. > > Thanks >I understand why you want to run it in the background but....what happens if there is an error? I do not write perfect code or test 100% of possible code paths or run on failproof hardware so there is always a possibility of an error. You will seem to have the situation where the user thinks everything was processed and saved into the db but that might not be true. I would not be happy if that happened with my data. Personally I would probably want to wait to see all was really successful. --~--~---------~--~----~------------~-------~--~----~ 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 think you can use ActiveMQ and Activemessaging plugin http://code.google.com/p/activemessaging/wiki/ActiveMessaging http://activemq.apache.org/ Frederick Cheung wrote:> On 23 Feb 2009, at 10:38, Ankit Parekh wrote: > > >> Hi all >> >> I am working on a heavy engineering project. And the requirement is >> that >> I needto do a lot of process before I store the data to the db. >> >> Now the question is that I want to do the process that I am doing >> but I >> want to do it in the background. What I actually mean to say is >> that..I >> just want the user to get a msg that Records Saved. But in real I want >> the process to go on in background. >> >> There r multiple callbacks used in my system. Also I dont want to use >> Starling or workling. pls suggest something where in my requirement is >> satisfied. Since i dont want the user to wait until my process is >> going >> on. >> >> > Well one of the other background processors (bj, backgroundrb etc. ) > might do the job > > Fred > >> thanks >> -- >> 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 -~----------~----~----~----~------~----~------~--~---