marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org
2006-Nov-08 22:12 UTC
Best way to create a reminders system (like backpack''s)
Hey all, I have some idea''s floating around in my head and I''d like any opinions on the best way to go about it and how to do it. I''m basically wanting to create a simple reminders system in my apps. Ideally it would be something similar to backpacks reminders, though now all I''m looking for is just email alert functionality. The process for the user I want to be as simple as: 1.) Click create 2.) Enter title, reminder note, due date and reminder (i.e 1 hour before, 1 day before, 1 week before etc..) 3.) Click save ... (#4 in the future) Email gets sent out based on when they want the reminder. What I''m trying to figure out is how best to "poll" the table rows of saved reminders to send out the actual emails in an accurate way. Do I use something like backgroundrb? Do I make a method that scans the db once a day via cron and "schedules" the reminders coming up to send out via ActionMailer? I don''t know how they designed the system in backpack but I wouldn''t think it would be too hard. Thanks for any ideas or advice 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 -~----------~----~----~----~------~----~------~--~---
Douglas Shearer
2006-Nov-08 22:50 UTC
Re: Best way to create a reminders system (like backpack''s)
Hi Marston. Best bet I would think would be to set up a daemon that runs, say, every 5 minutes. It would simply look at the table to see if any reminders are due to be sent out within the next 5 minutes. Using a daemon is the only realistic way of getting this to work well. Depending on the load you daemon implementation imposes on your server, you could even run it every 30seconds or so. When it comes to making a daemon in Rails, I''ve found the best thing is to use Kyle Maxwells Daemon Gem and Plugin. Basically this allows you to run code within your rails environment (So it has access to your models etc), and control them easily from the command line (./script/daemons start, stop, restart etc). The best place to start out is reading the posts and comments about it and the deprecation of its predecessor at "his blog":http://kylemaxwell.typepad.com/everystudent/rails_plugin/index.html I recently used this to allow my "blog":http://douglasfshearer.dyndns.org/ to poll flickr to see if any new images had been added. This runs once every hour, which is more than enough for the task at hand. Setup is a little fiddly, as his docs aren''t great (read the comments in his posts), so I plan to get round to writing an install guide for it. Hope this helps. Dougal. -- 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 -~----------~----~----~----~------~----~------~--~---
Douglas Shearer
2006-Nov-09 00:59 UTC
Re: Best way to create a reminders system (like backpack''s)
Douglas Shearer wrote:> Setup is a little fiddly, as his docs > aren''t great (read the comments in his posts), so I plan to get round to > writing an install guide for it.I was motivated enough to actually write my guide, check it out here: http://douglasfshearer.dyndns.org/blog/cron-jobs-in-ruby-on-rails Cheers. Dougal. -- 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 -~----------~----~----~----~------~----~------~--~---
aaronworsham
2006-Nov-09 15:34 UTC
Re: Best way to create a reminders system (like backpack''s)
I believe the new version of BackgrounDrb has a scheduler task built into. According to Ezra''s page ''The new release comes with a brand new job scheduler. You can use simple triggers like repeat_every or you can get more complex and use full cron compatible syntax.'' I haven''t used it so I can''t say how well it fits your needs. It may be a good Ruby based alternative to cron. http://brainspl.at/articles/2006/10/30/backgroundrb-0-2-0-released --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org
2006-Nov-10 07:50 UTC
Re: Best way to create a reminders system (like backpack''s)
excellent guys, thanks for the info. I will definitely check it out. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
marston-8Qo2DTIsO68RmelmmXo44Q@public.gmane.org
2006-Nov-10 10:37 UTC
Re: Best way to create a reminders system (like backpack''s)
Another option I was thinking about after checking out all this stuff was perhaps to just write a single method to do it all and put a runner that calls it in cron and have that set for every 5 minutes or so. But from a efficiency and simplicity standpoint are there some bad points to that idea? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---