Vincent Driessen
b4c1c85276
Add equality and comparison methods.
13 years ago
Vincent Driessen
a5ea45af57
Make the dequeue methods return values consistent.
...
I merely refactored the internal calls. No external API changes have been made in this commit. In order to make the dequeueing methods consistent, each dequeue method now returns a Job instance, which is just a nice lightweight wrapper around the job tuple.
The Job class makes it easier to pass the method call info around, along with some possible meta information, like the queue the job originated from.
This fixes #7 .
13 years ago
Vincent Driessen
f492a5ae2b
Restructure some code.
...
No functional change, but leave the BLPOP'ing to the Queue, as the
queues know how to pop themselves.
13 years ago
Vincent Driessen
1a893e60cf
Have work() return whether work has been done, or not.
...
And promote Worker to the rq namespace, so you can
from rq import Worker
13 years ago
Vincent Driessen
1c9fa66bc1
Greatly simplify the setup.
...
Jobs don't even need to be tagged. Any function can be put on queues.
13 years ago
Vincent Driessen
62b6b180f3
Also allow args and kwargs to enqueue() calls on Queue.
13 years ago
Vincent Driessen
196a9815d2
Add dequeue method to Queue.
13 years ago
Vincent Driessen
b5e0377eb0
Allow jobs to be declared without a default queue.
...
This makes it impossible to use delay() on them. Instead, you should
use enqueue().
13 years ago
Vincent Driessen
407f3e8b38
Add ability to put work on alternate queues.
13 years ago
Vincent Driessen
1b8da4a861
Add test for putting work on queues.
13 years ago
Vincent Driessen
8dfdd452ef
Bugfix.
...
Yeah, it's getting late.
It's my own fault.
I know.
13 years ago
Vincent Driessen
04c88577ed
Bugfix: LPOP does not support multiple queue arguments.
...
Redis' BLPOP command takes multiple queue arguments, but LPOP can only
take a single queue. Therefore, we need to loop over all queues
manually, in order, and raise an exception is no more work is available.
13 years ago
Vincent Driessen
a77c3d9104
Support quitting when all work is done (i.e. queue is empty).
13 years ago
Vincent Driessen
8dc2b15a6e
Remove empty file.
...
It is obsoleted by rq/proxy.py
13 years ago
Vincent Driessen
98ffcd8e05
Create soft dependency on logbook.
13 years ago
Vincent Driessen
227e107a82
Oops, fix some old references to current_connection.
13 years ago
Vincent Driessen
d721f0708b
Refactor the whole Redis connection stuff to be just as easy as in RDB.
13 years ago
Vincent Driessen
518db8c24b
Add better connection management.
...
To start using RQ, push a Redis connection up its stack, like so:
from rq import push_connection
push_connection(Redis())
13 years ago
Vincent Driessen
d8d388c841
Log the results of jobs.
13 years ago
Vincent Driessen
f21b2af2b6
Make it an actual PyPI-managable Python package.
13 years ago