1

We need a service that we can use to schedule events. For instance, we might have a task that needs to run at 3 o'clock (one time) or that runs every 2 hours (multiple times). Preferably each task could be configured with an AMQP queue that it would publish to.

We could easily implement this by creating an OS timer event. My concern is how to recover if this service ever went down. We could use CRON if it was something that allowed scheduling on-the-fly.

I was looking for a way to avoid reinventing the wheel. If there isn't a project out there that does this already, we will just create one. This is a pretty common thing, though, so I'd be surprised if no one's put one out there by now.

Travis Parks
  • 8,435
  • 12
  • 52
  • 85

1 Answers1

2

Celery solves this problem.

celery.schedules lets you define periodic tasks. And you can override is_due to do things like schedule once a month. You can schedule tasks to execute at a specific time using periodic_task, or celery-beat (which I believe is now the standard approach). Yet another way is to use the eta argument to Task.apply_async.

Community
  • 1
  • 1
ire_and_curses
  • 68,372
  • 23
  • 116
  • 141
  • Celery seems like a really heavy-weight solution. There is a lot of additional functionality we'd never use. I will look into Celery some more - perhaps we can use it in other ways. – Travis Parks Sep 06 '12 at 02:06