* Replaced async keyword with is_async in the Queue class to fix reserved keyword syntax errors in Python 3.7
* Updated tests to use is_async keyword when instantiating Queue objects
* Updated docs to reference is_async keyword for Queue objects
* Updated tox.ini, setup.py and .travis.yml with references to Python 3.7
and marked as `failed`. Its default unit is second and it can be an integer or a string representing an integer(e.g. `2`, `'2'`). Furthermore, it can be a string with specify unit including hour, minute, second(e.g. `'1h'`, `'3m'`, `'5s'`).
and marked as `failed`. Its default unit is second and it can be an integer or a string representing an integer(e.g. `2`, `'2'`). Furthermore, it can be a string with specify unit including hour, minute, second(e.g. `'1h'`, `'3m'`, `'5s'`).
* `result_ttl` specifies the expiry time of the key where the job result will
* `result_ttl` specifies the expiry time of the key where the job result will
be stored
be stored
* `ttl` specifies the maximum queued time of the job before it'll be cancelled.
* `ttl` specifies the maximum queued time of the job before it'll be cancelled.
If you specify a value of `-1` you indicate an infinite job ttl and it will run indefinitely
If you specify a value of `-1` you indicate an infinite job ttl and it will run indefinitely
* `depends_on` specifies another job (or job id) that must complete before this
* `depends_on` specifies another job (or job id) that must complete before this
job will be queued
job will be queued
@ -104,7 +104,7 @@ from rq import Queue
from redis import Redis
from redis import Redis
redis_conn = Redis()
redis_conn = Redis()
q = Queue(connection=redis_conn)
q = Queue(connection=redis_conn)
# Getting the number of jobs in the queue
# Getting the number of jobs in the queue
print len(q)
print len(q)
@ -168,10 +168,10 @@ print job.result
For testing purposes, you can enqueue jobs without delegating the actual
For testing purposes, you can enqueue jobs without delegating the actual
execution to a worker (available since version 0.3.1). To do this, pass the
execution to a worker (available since version 0.3.1). To do this, pass the
`async=False` argument into the Queue constructor:
`is_async=False` argument into the Queue constructor:
You may wish to include your RQ tasks inside unit tests. However many frameworks (such as Django) use in-memory databases which do not play nicely with the default `fork()` behaviour of RQ.
You may wish to include your RQ tasks inside unit tests. However many frameworks (such as Django) use in-memory databases which do not play nicely with the default `fork()` behaviour of RQ.
Therefore, you must use the SimpleWorker class to avoid fork();
Therefore, you must use the SimpleWorker class to avoid fork();