Commit Graph

151 Commits

Author SHA1 Message Date
Vincent Driessen 1a8b80604d Minor refactoring to make the to-failed queue code a bit more readable. 2012-02-13 16:51:47 +01:00
Vincent Driessen 11c7dbb376 Consistently renamed "failure" -> "failed" queue.
Fixes #28.
2012-02-13 16:46:39 +01:00
Vincent Driessen 9f5b1545b6 Fix: store the job result in the correct key.
And expire job hash in Redis after 500 seconds (by default).

Fixes #27.
2012-02-13 16:44:38 +01:00
Vincent Driessen 7bda1ca969 Encapsulate the result property (it should not directly be set). 2012-02-13 16:43:27 +01:00
Vincent Driessen 6266f68310 Style fixes (flake8). 2012-02-13 14:01:15 +01:00
Vincent Driessen 10c48e1dbd Merge branch 'use-cpickle' 2012-02-13 14:00:32 +01:00
Vincent Driessen 8da204f74a Always use cPickle, never 'regular' pickle.
This fixes #18.
2012-02-13 13:59:24 +01:00
Vincent Driessen 9318825429 Abstract away from the concrete pickle implementation.
Choose cPickle, if available, for best performance.
2012-02-13 13:59:24 +01:00
Vincent Driessen c4553f2a22 Merge branch 'rewrite-data-model' 2012-02-13 13:58:54 +01:00
Vincent Driessen abc66171eb Simplify the count_words_at_url example.
The long implementation derived attention a bit from the actual point of
enqueuing here.
2012-02-13 13:57:36 +01:00
Vincent Driessen 39f106cdb3 Have the test suite find an empty Redis database.
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.
2012-02-13 09:08:33 +01:00
Vincent Driessen 90a458ca8e Add more colorful terminal output.
For better visual parsability.
2012-02-10 18:33:11 +01:00
Vincent Driessen 63ef198fd6 Improve work generator. 2012-02-10 18:32:59 +01:00
Vincent Driessen 791f8169f5 Remove dead code. 2012-02-10 17:52:32 +01:00
Vincent Driessen e05acfedce Fix putting jobs on the failure queue when they fail. 2012-02-10 17:19:30 +01:00
Vincent Driessen 7c903e45ef Simplify the persistence of jobs.
Fixes #23 and #24.
2012-02-10 17:18:51 +01:00
Vincent Driessen bffe6cbbde Encapsulate internal function call representation.
This means it's not allowed anymore to directly set func, args, and
kwargs.  Instead, use the for_call() constructor.
2012-02-10 17:15:16 +01:00
Vincent Driessen 370399f8f7 CHECKPOINT: dequeue_any now returns the queue that was popped from. 2012-02-08 17:55:38 +01:00
Vincent Driessen f516f8df2e CHECKPOINT: Handle failing and unreadable jobs.
Failing (or unreadable) jobs are correctly put on the failure queue by
the worker now.
2012-02-08 15:18:27 +01:00
Vincent Driessen b1650cb9b9 CHECKPOINT: Second part of the big refactoring.
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.
2012-02-08 14:18:17 +01:00
Vincent Driessen 65105b44c3 CHECKPOINT: Initial part of the big refactor. 2012-02-08 00:40:43 +01:00
Vincent Driessen 7fff52d99c Get rid of ugly custom assertion. 2012-02-07 20:59:29 +01:00
Vincent Driessen fcca48a9d7 Rename empty property -> is_empty() method. 2012-02-07 20:53:06 +01:00
Vincent Driessen 9986fee00e Pass test output through rg. 2012-02-05 09:14:40 +01:00
Vincent Driessen 4d2f64d4b6 Mental note to self. 2012-02-01 07:34:35 +01:00
Vincent Driessen 20e908039f Initially set the exc_info property, so it does not raise an
AttributeException when accessed.
2012-02-01 07:33:41 +01:00
Vincent Driessen fdce187c27 Putting failed jobs on the failure queue. 2012-01-30 20:55:52 +01:00
Vincent Driessen 7eb8d92605 Put unreadable tasks on the failure queue. 2012-01-30 19:41:13 +01:00
Vincent Driessen 0be1cb6ac0 Change the way jobs are pickled.
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.
2012-01-30 16:52:28 +01:00
Vincent Driessen 0503eb2829 Clarified responsibility of the Job class.
The Job itself has nothing to do with queueing and dequeueing, so the
DequeueError wasn't appropriate here, either.
2012-01-28 09:00:02 +01:00
Vincent Driessen db5753b0d6 Put Job in its own file. 2012-01-28 08:02:28 +01:00
Vincent Driessen 1f64157c38 Broke down tests into multiple files. 2012-01-28 07:58:40 +01:00
Vincent Driessen 210477c2ab Throw DequeueError when reading unprocessable data from queue. 2012-01-27 15:17:14 +01:00
Vincent Driessen aa2c9e85eb Use 'busy' and 'idle' to replace the unicode symbols. 2012-01-27 11:38:55 +01:00
Vincent Driessen cce85c11c5 Fix missing import statement. 2012-01-27 11:38:27 +01:00
Vincent Driessen 62ae299114 Fix mathematical meaning of the < operator.
This is used for alphabetical queue ordering.
2012-01-27 11:37:46 +01:00
Vincent Driessen aa030e0e36 Fix syntax error inside shell script. 2012-01-25 15:24:58 +01:00
Vincent Driessen e992d65a30 Add RPM dependencies. 2012-01-25 10:46:11 +01:00
Vincent Driessen a111db13fd Allow users to specify the import path manually, if the default (current
working directory) is undesired.
2011-12-13 17:09:58 +01:00
Vincent Driessen 2ac6c1faa3 Allow includes from the local directory by default.
Will build in a flag in the future to be able to disallow this.
2011-12-12 10:44:52 +01:00
Vincent Driessen 7be878aed7 Allow specification of DB.
(And fix the worker actually being able to connect to a different
database.)
2011-11-28 21:02:42 +01:00
Vincent Driessen 5c6f002878 Silently pass when trying to kill child that is already dead.
This fixes #16.
2011-11-28 15:15:18 +01:00
Vincent Driessen 039a132374 Add ellipsis, to indicate we're waiting here. 2011-11-28 15:04:42 +01:00
Vincent Driessen b27786332c Also use argparse for the rqworker. 2011-11-28 15:04:24 +01:00
Vincent Driessen 903f1b9f46 Fix command description. 2011-11-28 15:03:49 +01:00
Vincent Driessen 27ddde2008 Make procname a hard dependency. 2011-11-28 14:17:42 +01:00
Vincent Driessen 2ff383162c Fix bug #15. 2011-11-28 14:14:11 +01:00
Vincent Driessen da228dd76c Fix casing. 2011-11-28 14:07:12 +01:00
Vincent Driessen 2300338893 Update dependencies accordingly 2011-11-28 14:07:04 +01:00
Vincent Driessen 1dba21f176 Add --host and --port options to specify what Redis to use. 2011-11-28 13:58:13 +01:00