32 Commits (c427eda36cc6d729d8078d04539a1707b637aeba)

Author SHA1 Message Date
Selwin Ong f498de57b6 Always call job.save even on synchronous queues so get_current_job doesn't fail 12 years ago
Vincent Driessen 10237ddcb4 Merge branch 'job-access-within-job'
Conflicts:
	CHANGES.md
	rq/job.py
12 years ago
Vincent Driessen 8cb6a21670 Only store custom properties when they're written to the meta dict. 12 years ago
Vincent Driessen 5e80aa27eb Fix comment. 12 years ago
Vincent Driessen 95d3aed98e Store the job ID on the internal stack.
It does so instead of the instance itself.  Still returns the job---the
interface hasn't changed.
12 years ago
Vincent Driessen 372de4b45a Implement the get_current_job() function.
This fixes #125.
12 years ago
Vincent Driessen 83369f3b9b Prefer `result` over `return_value`.
`return_value` still is available as a backward-compatible accessor.

This fixes #116.
13 years ago
Selwin Ong a5e6765990 Added "result_ttl" property on jobs that determines how long job results are persisted in Redis. 13 years ago
Vincent Driessen f6e67431d7 Refactor the .enqueue() API to not gobble the timeout kwargs.
This fixes #98.
13 years ago
Vincent Driessen 3a8f30a53e Add test. 13 years ago
Vincent Driessen 604fce99a1 Merge with master. 13 years ago
Selwin Ong 1fb0a1bfac Modified ``Job`` ``save`` and ``refresh`` methods to support persisting
additional ``Job`` attributes into Redis.
13 years ago
Omar Khan 03bd49511d Allow instance methods to be enqueued
Only works for picklable instances
13 years ago
Vincent Driessen b45770cd3c Fix unit test expressions. 13 years ago
Vincent Driessen 98ea29b15a Don't expose the Job class at the top-level.
This partially fixes #37.
13 years ago
Vincent Driessen 2b6101d110 Move job from Worker to Job test suite. 13 years ago
Vincent Driessen 15342f14d3 Store pickled function calls as strings.
This aids unpacking in the case of a function that isn't importable from
the worker's runtime. The unpickling will now (almost) always succeed,
and throw an ImportError later on, when the function is actually
accessed (thus imported implicitly).

The end result is a job on the failed queue, with exc_info describing
the import error, which is tremendously useful.
13 years ago
Vincent Driessen e807748ee6 Test the timing out of jobs.
Really looking for a way to speed up this test.  It takes up a whole
second doing nothing now, really.
13 years ago
Vincent Driessen f07d28db86 Organize test fixtures into a separate file. 13 years ago
Vincent Driessen 5717a0ba15 Rename Job.for_call() -> Job.create().
This fixes #34.
13 years ago
Vincent Driessen 7e0b843d06 Implement requeue() method on FailedQueue. 13 years ago
Vincent Driessen 8e85c7eee3 Put Job directly in the top-level `rq` module. 13 years ago
Vincent Driessen 53f55ba986 Flake8 style fixes in the test suite. 13 years ago
Vincent Driessen 7bda1ca969 Encapsulate the result property (it should not directly be set). 13 years ago
Vincent Driessen 8da204f74a Always use cPickle, never 'regular' pickle.
This fixes #18.
13 years ago
Vincent Driessen 9318825429 Abstract away from the concrete pickle implementation.
Choose cPickle, if available, for best performance.
13 years ago
Vincent Driessen 7c903e45ef Simplify the persistence of jobs.
Fixes #23 and #24.
13 years ago
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.
13 years ago
Vincent Driessen 65105b44c3 CHECKPOINT: Initial part of the big refactor. 13 years ago
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.
13 years ago
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.
13 years ago
Vincent Driessen 1f64157c38 Broke down tests into multiple files. 13 years ago