Jeff,

You could use the same approach as Ryan in his last backgournd job
screencast: http://railscasts.com/episodes/129-custom-daemon.

Or take a look at some scheduler for the task (already passing the
specific user information).

I spent some time researching background tasks, my notes might help
you:

                                                                BACKGROUND 
PROCESSES                                                    
--------------------

http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails

== Asynchronous Tasks

Launched from Rails request/reponse cycle + optional Message Queueing

- Options
        . ar_mailer (only for emails)   => GOOD (only email)
        . starling + workling                   => EXCELLENT
        . Ap4r
        . Spawn / background                    => SIMPLE
        . ActiveMessaging
        . BackgroundFu
        . WorkerQueue
        . Rake in Background                    => SIMPLES
          (http://railscasts.com/episodes/127-rake-in-background)

== Recurring Jobs (cron-style)

Scheduled or permanently running in the background

- Options
        . daemon_generator (rails_cron) => SIMPLE
          http://railscasts.com/episodes/129-custom-daemon
        . BackgrounDRb
        . rufus-scheduler                               => GOOD
        . Taskr
        . UNIX Cron and Runner (simple, but consumes resources and you can't
controll well)


Cheers, Sazima

On Oct 21, 12:33 am, Jeff Pritchard <[EMAIL PROTECTED]>
wrote:
> OK, time to come clean.  Right now my app is doing something really
> cheesy.  The first step is alway admitting that you have a problem,
> right?
>
> So here's the deal.  One of the features of my app is that, based on
> some user settings, it is supposed to send out "reminder" emails at
> certain times of the day.  Each user has their own time settings for
> these reminders.
>
> Right now I have a background task that, once every 15 mins, looks at
> every gosh darn user and decides whether or not to send them a reminder.
> Once every 15 mins I hit every single user row in the database.
> brrrrrrr.  Yeah, I know, gives me the willies too.
>
> So is there some sort of a "best practice" established for how to do
> some caching/intelligent-scheduling to overcome this horrendous mis-use
> of the database?  Is there some sort of a plugin that would allow me to
> sort the database by that time-of-day column and intelligently find just
> those within a certain range of times?
>
> I'm very nearly an SQL virgin, so if this is painfully simple and I'm
> just a moron, be gentle.
>
> thanks,
> jp
> --
> 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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to