Luke Smith
Luke Smith

Reputation: 692

Is it possible to string / queue Ruby actions?

I've written a number of actions in a RoR app, that perform different actions within process.

E.g. - One action communicates with a third party service using their API and collects data. - Another processes this data and places it into a relevant database. - Another takes this new data and formats it in a specific way. etc..

I would like to fire off the process at timed intervals, eg. Each hour. But I don't want to do the whole thing each time.

Sometimes I may just want to do the first two actions. At other times, I might want to do each part of the process.

So have one action run, and then when it's finished call another action. ETC..

The actions could take up to an hour to complete, if not longer, so I need a solution that won't timeout.

What would be the best way to achieve this?

Upvotes: 3

Views: 194

Answers (1)

Tyler
Tyler

Reputation: 11499

You have quite a few options for processing jobs in the background:

Just read through and pick the one that seems to fit your criteria the best.

EDIT As you clarified, you want regularly scheduled tasks. Clockwork is a great gem for that (and generally a better option than cron):

Upvotes: 3

Related Questions