Hi, In my application I have to send an http post request to another server for some processing. My application crashes if it has to make 100+ requests in a loop based on some business logic. Basically, user is just waiting for the whole processing to be finished before he could do something else. I realize that best option is to put the whole processing in a background job. Now my problem is that I can''t figure out a way to do asynchronus http post for sending a request to remote server. Till now I have been using Net:Http post but this is call which is causing the problem. Also can you please suggest as to how can schedule the background job to be fired at particular date/time to make all the asynchronus call in the background. Any help is greatly appreciated. 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 -~----------~----~----~----~------~----~------~--~---
Rm Rm wrote:> > Any help is greatly appreciated. > > Thanks.check out remote_function(), link_to_remote(), submit_to_remote() for server side async processing. hth ilan -- 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 -~----------~----~----~----~------~----~------~--~---
I have used these for making ajax call from client side rhtml codes. Can I use these calls from server-side also to make async calls to another domain ? Ilan Berci wrote:> Rm Rm wrote: > >> >> Any help is greatly appreciated. >> >> Thanks. > > check out remote_function(), link_to_remote(), submit_to_remote() for > server side async processing. > > hth > > ilan-- 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 -~----------~----~----~----~------~----~------~--~---
Rm Rm wrote:> I have used these for making ajax call from client side rhtml codes. Can > I use these calls from server-side also to make async calls to another > domain ? > > Ilan Berci wrote: >> Rm Rm wrote: >> >>> >>> Any help is greatly appreciated. >>> >>> Thanks. >> >> check out remote_function(), link_to_remote(), submit_to_remote() for >> server side async processing. >> >> hth >> >> ilanNo, these methods get translated into javascript callbacks, if you need to it from the server side, then take a look at the gem machanize,on the server, you are totally free to spin off a new thread to make a request anywhere you want.. -- 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 -~----------~----~----~----~------~----~------~--~---
BackgroundRb is another good option. You can start the request in another thread and monitor it''s progress from the controller. On Feb 24, 3:25 pm, Ilan Berci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Rm Rm wrote: > > I have used these for making ajax call from client side rhtml codes. Can > > I use these calls from server-side also to make async calls to another > > domain ? > > > Ilan Berci wrote: > >> Rm Rm wrote: > > >>> Any help is greatly appreciated. > > >>> Thanks. > > >> check out remote_function(), link_to_remote(), submit_to_remote() for > >> server side async processing. > > >> hth > > >> ilan > > No, these methods get translated into javascript callbacks, if you need > to it from the server side, then take a look at the gem machanize,on the > server, you are totally free to spin off a new thread to make a request > anywhere you want.. > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---