Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create REDIS based job queue #34

Open
bwhite opened this issue Apr 28, 2013 · 0 comments
Open

Create REDIS based job queue #34

bwhite opened this issue Apr 28, 2013 · 0 comments

Comments

@bwhite
Copy link
Owner

bwhite commented Apr 28, 2013

A simple job queue that has

  • Script "worker.py" that can be run as a standalone worker client, point it to the redis
  • Functions that may register a job (worker.run('task', **kw)) with the queue or execute the task immediately in a subprocess (depending on what mode is set, for test servers we can just run everything on the same machine)
  • Use BRPOPLPUSH in REDIS to take a task from the available tasks and put it on the processing tasks list. The task must be updated with worker info.
  • Each worker has a heartbeat on REDIS periodically so that we can tell if it died or if it still running a job.
  • Server does a blocking pop on the result key, so when the worker puts the data there it is returned to the client.
  • If a worker died while it is processing a job, for now we can just remove the job and return an error to the client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant