RailsSon
RailsSon

Reputation: 20637

Ruby on Rails - Users Scheduling Tasks

I am working on an application which people can sign up to and schedule tasks to be done.

When the user schedules a task they enter a date and time. I want the application to wake up and send an email to the user at the date and time they have entered.

I am unsure what gems/plugins to use in rails to achieve this, anyone have a suggestion?

Cheers

Eef

Upvotes: 1

Views: 1528

Answers (4)

Ryan Bigg
Ryan Bigg

Reputation: 107728

Run a cron job every minute that runs a rake task that checks the database for any un-run tasks in the past.

This way if your system goes down (hint: it will) when you bring it back up the cronjob will pick up the slack left behind.

Upvotes: 1

Teddy
Teddy

Reputation: 18572

The Unix 'at' command is also useful. Just execute a shell that calls 'at'.

Upvotes: 0

Roman
Roman

Reputation: 13058

There's also a backgroundrb. Also check this thread.

Upvotes: 0

Alex Korban
Alex Korban

Reputation: 15126

delayed_job should do the trick. It allows you to schedule tasks to run at a particular time. All you need to do is schedule a function that sends an email.

Upvotes: 2

Related Questions