Commit Graph

221 Commits

Author SHA1 Message Date
Vincent Driessen 8aaa975fa9 Find all packages.
This fixes #67.
2012-05-15 08:37:11 +02:00
Vincent Driessen f958d26dfd Add change log. 2012-05-14 08:41:56 +02:00
Vincent Driessen 7c69ad9182 Bump the version number. 2012-05-08 15:21:17 +02:00
Vincent Driessen 11f91508c6 Merge pull request #63 from selwin/master
Queue.lpop now takes connection as an argument. Thanks, @selwin!
2012-05-08 06:00:44 -07:00
Vincent Driessen b47fc4aa14 Merge pull request #59 from wichert/console-scripts
Refactor scripts. Thanks, @wichert!
2012-05-08 05:59:32 -07:00
Selwin Ong 5989228330 Queue.lpop should take connection as argument. 2012-05-08 16:39:09 +07:00
Wichert Akkerman ec0e4776b4 Move common code out. 2012-05-04 10:04:37 +02:00
Wichert Akkerman 9f7d608da8 Renaming typo.. 2012-05-04 10:00:31 +02:00
Wichert Akkerman 2d4a58631d PyFlakes 2012-05-04 09:57:44 +02:00
Wichert Akkerman 97d2e4d784 Use console_scripts instead of scripts.
Unfortunately zc.buildout does not support distribute/setuptools script
option (see https://bugs.launchpad.net/zc.buildout/+bug/422724), but it
does support console_scripts. This also makes the scripts importable,
allowing for unittest and code reuse.
2012-05-04 09:49:18 +02:00
Vincent Driessen 1d27223069 Merge pull request #56 from mattdennewitz/master
Class methods use given class, not hard-coded class
2012-04-19 10:23:28 -07:00
mattdennewitz 9f2f9e367c Class methods now use given "cls" 2012-04-18 10:54:52 -05:00
Vincent Driessen bbfe621bd1 Mention python-requests.org, for completeness sake. 2012-04-02 08:37:47 +02:00
Vincent Driessen 42c3b593f9 Fix typo in basic example. 2012-04-02 00:33:44 +02:00
Vincent Driessen b886ba76de Fix AttributeError. 2012-04-02 00:32:59 +02:00
Vincent Driessen c337afde3a Make the connection stack thread safe.
For this, I've included Werkzeug's context locals, which offers both
thread and greenlet safe local variables.

This fixes #47.
2012-04-01 19:50:45 +02:00
Vincent Driessen 282f4be931 Merge branch 'total-ordering-fix' 2012-04-01 09:25:51 +02:00
Vincent Driessen 25d3f94c9f Use the true Python 2.7 stdlib implementation instead. 2012-04-01 09:25:27 +02:00
Vincent Driessen 4885458dde Move this hack to a separate file. 2012-04-01 09:22:39 +02:00
Vincent Driessen c642df93b9 Don't use dict comprehension. It's Python 2.7 only.
This fixes #51.
2012-04-01 08:48:46 +02:00
aiko1895 d26db69cbd added backport of total_ordering to work with 2.6 2012-03-31 15:49:48 +03:00
Vincent Driessen 100d23b72e Tag the first public release. 2012-03-28 22:17:40 +02:00
Vincent Driessen ccc9abd8fa Fix wording. 2012-03-28 10:57:01 +02:00
Vincent Driessen 166a79a0fd Fix documentation URL. 2012-03-28 10:53:24 +02:00
Vincent Driessen 506f7c9e17 Fix incorrect API call in the README example. 2012-03-28 10:52:12 +02:00
Vincent Driessen 31e492644e Fix year. 2012-03-28 10:49:28 +02:00
Vincent Driessen b0c9ab168d Never refresh when stdout is not a TTY.
This fixes #43.
2012-03-27 12:23:56 +02:00
Vincent Driessen 59aebf8676 Don't filter when no queues are explicitly specified.
This caused the workers from omitting empty queues from workers, as if
they were not listening on them.
2012-03-27 12:17:41 +02:00
Vincent Driessen 2e5f537abd Rewrite rqinfo to start polling by default.
The options to show only partial info (only workers, only queues) are
kept, but not default anymore.  This makes the default invocation
(without args) the most useful one.

The default refresh interval is 2.5 seconds.

This fixes #42.
2012-03-27 11:22:22 +02:00
Vincent Driessen a7c229ddb1 Reflect new API in the RQ scripts. 2012-03-23 15:15:29 +01:00
Vincent Driessen 2982486448 New connection management.
Connections can now be set explicitly on Queues, Workers, and Jobs.
Jobs that are implicitly created by Queue or Worker API calls now
inherit the connection of their creator's.

For all RQ object instances that are created now holds that the
"current" connection is used if none is passed in explicitly.  The
"current" connection is thus hold on to at creation time and won't be
changed for the lifetime of the object.

Effectively, this means that, given a default Redis connection, say you
create a queue Q1, then push another Redis connection onto the
connection stack, then create Q2. In that case, Q1 means a queue on the
first connection and Q2 on the second connection.

This is way more clear than it used to be.

Also, I've removed the `use_redis()` call, which was named ugly.
Instead, some new alternatives for connection management now exist.

You can push/pop connections now:

    >>> my_conn = Redis()
    >>> push_connection(my_conn)
    >>> q = Queue()
    >>> q.connection == my_conn
    True
    >>> pop_connection() == my_conn

Also, you can stack them syntactically:

    >>> conn1 = Redis()
    >>> conn2 = Redis('example.org', 1234)
    >>> with Connection(conn1):
    ...     q = Queue()
    ...     with Connection(conn2):
    ...         q2 = Queue()
    ...     q3 = Queue()
    >>> q.connection == conn1
    True
    >>> q2.connection == conn2
    True
    >>> q3.connection == conn1
    True

Or, if you only require a single connection to Redis (for most uses):

    >>> use_connection(Redis())
2012-03-23 15:10:49 +01:00
Vincent Driessen a662180fd3 Make importlib dependency conditional on the Python version. 2012-03-22 14:51:27 +01:00
Vincent Driessen 6bc173f122 Bugfix. 2012-03-22 14:12:36 +01:00
Vincent Driessen 28216cf63a Implement the requeue_job() top-level API function.
This completely fixes #37.
2012-03-21 15:25:20 +01:00
Vincent Driessen c684949045 Don't expose the FailedQueue class at the top-level.
This fixes #36.
2012-03-21 15:25:03 +01:00
Vincent Driessen 98ea29b15a Don't expose the Job class at the top-level.
This partially fixes #37.
2012-03-21 15:05:58 +01:00
Vincent Driessen 0b837b4b12 Don't warn. In fact, we rely on this the more. 2012-03-21 13:58:37 +01:00
Vincent Driessen 2b6101d110 Move job from Worker to Job test suite. 2012-03-21 13:18:01 +01:00
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.
2012-03-21 13:09:52 +01:00
Vincent Driessen 14ecb8e956 Add specifics on the "ImportError" to the message in case of an attribute error. 2012-03-16 15:51:46 +01:00
Vincent Driessen be8f7684aa Fix accidentally passing unit test. 2012-03-16 14:21:00 +01:00
Vincent Driessen df2b2838de Merge branch 'timeouts'
This fixes #12.
2012-03-16 10:05:41 +01:00
Vincent Driessen 3c05f20d95 Flake8. 2012-02-24 11:36:33 +01:00
Vincent Driessen 844c5ed8c7 Add @slow wrapper to avoid running slow tests.
Use ./run_tests -f to only run the fast tests.
2012-02-24 07:39:44 +01:00
Vincent Driessen 91fff48389 Flake8. 2012-02-22 18:03:04 +01:00
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.
2012-02-22 18:01:14 +01:00
Vincent Driessen 9ac9c23412 Flake8. 2012-02-22 17:39:14 +01:00
Vincent Driessen 000849c430 Initialize jobs with timeouts. 2012-02-22 17:36:42 +01:00
Vincent Driessen b8305a818f Safer, and shorter, version of the death penalty.
This case protects against JobTimeoutExceptions being raised immediately
after the job body has been (successfully) executed.  Still,
JobTimeoutExceptions pass through naturally, like any other exception,
to be handled by the default exception handler that writes failed jobs
to the failed queue.

Timeouts therefore are reported like any other exception.
2012-02-22 16:57:13 +01:00
Vincent Driessen 8a856e79ea Initial attempt at job timeouts. 2012-02-22 16:57:11 +01:00