Hi all, I have a problem. I want to call some function after every 10 minutes. But I don''t it. -- 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-/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.
Vuong Hung wrote:> Hi all, > > I have a problem. > > I want to call some function after every 10 minutes. But I don''t it.JavaScript functions can be used for this effect in most instances. Though it depends on which function you want to execute, of course. -- 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-/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.
Robert Walker
2010-Jun-16 15:27 UTC
Re: how to call a function after 10 minutes or second?
Vuong Hung wrote:> Hi all, > > I have a problem. > > I want to call some function after every 10 minutes. But I don''t it.Please provide more detail. Are you asking about server-side or client-side? If you are asking about server-side there are options like delayed_job: http://github.com/collectiveidea/delayed_job Or, in case the action to perform is very simple you can use use something like curl to send requests periodically to a url using cron: $ crontab -e */10 * * * * curl http://example.com/action If you''re talking about client-side (JavaScript) then there are timing events that you can use for delayed or repeating events: http://www.w3schools.com/js/js_timing.asp If you''re using the Prototype JavaScript library it provides the Ajax.PeriodicalUpdater if you want to repeatedly send a request on an interval. http://api.prototypejs.org/ajax/ajax/periodicalupdater/ -- 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-/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.