Since the test suite `flushdb()`'s after running each test, we should
make sure the database is empty before we even start running tests.
This patch will make sure to never destroy any local production data
inside the running Redis instance.
This fixes#25.
Jobs are now stored in separate keys, and only job IDs are put on Redis
queues. Much of the code has been hit by this change, but it is for the
good.
No really.
There is no job tuple anymore, but instead Jobs are picklable by
themselves natively. Furthermore, I've added a way to annotate Jobs
with created_at and enqueued_at timestamps, to drive any future Job
performance stats. (And to enable requeueing, while keeping hold of the
queue that the Job originated from.)
This fixes#17.
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.