8

I have a series of maintenance tasks for a python WSGI application that are a bit too complex for a crontab (jobs need to be run at frequencies derived from the size of the job queue, manage a connection pool to a group of EC2 instances, etc).

How should I implement a long-running, event-driven python program? I've never needed this functionality before, so I'm not even sure what to google.

2
  • 1
    twistedmatrix.com/trac ? Commented Aug 29, 2011 at 23:21
  • @zengr, twisted and python-daemon are the first two things that come to mind, but I wanted to see if I was missing something in the standard library before I commit to anything. I'm still a bit new to python. Commented Aug 29, 2011 at 23:28

1 Answer 1

7

Most of the large, modern python sites are using Celery for this type of work. It is a distributed task queue that supports scheduling of tasks as well.

Though probably a bit heavyweight for a small site, it'll grow with you. I'm looking to implement it myself (sans Rabbit) shortly.

I recently found another choice for django users, django-tasks which is focused on fewer, longer, batch processing type jobs. There is also django-ztask using zeromq.

Addendum: Just came across gearman which has python bindings.

Sign up to request clarification or add additional context in comments.

1 Comment

Ah, apparently the google query I was looking for was "python asynchronous task queue". :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.