Merge pull request #46 from Koed00/dev

Adds global `sync` configuration option
This commit is contained in:
Ilan Steemers
2015-08-13 10:52:45 -07:00
9 changed files with 47 additions and 13 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ author = 'Ilan Steemers'
# The short X.Y version.
version = '0.5'
# The full version, including alpha/beta/rc tags.
release = '0.5.1'
release = '0.5.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+10 -1
View File
@@ -1,5 +1,6 @@
Installation
============
.. py:currentmodule:: django_q
- Install the latest version with pip::
@@ -91,6 +92,14 @@ Limits the amount of successful tasks saved to Django.
- Defaults to ``250``
- Failures are always saved.
.. _sync:
sync
~~~~
When set to ``True`` this configuration option forces all :func:`async` calls to be run with ``sync=True``.
Effectively making everything synchronous. Useful for testing. Defaults to ``False``.
.. _queue_limit:
queue_limit
@@ -102,7 +111,7 @@ It can also be used to manage the loss of data in case of a cluster failure.
Defaults to ``None``, meaning no limit.
label
~~~~~
~~~~~Dev
The label used for the Django Admin page. Defaults to ``'Django Q'``
+9
View File
@@ -54,6 +54,7 @@ Overrides the cluster's timeout setting for this task.
sync
""""
Simulates a task execution synchronously. Useful for testing.
Can also be forced globally via the :ref:`sync` configuration option.
redis
"""""
@@ -213,6 +214,14 @@ Reference
Renamed from get_task
.. py:function:: queue_size()
Returns the size of the broker queue.
Note that this does not count tasks currently being processed.
:returns: The amount of task packages in the broker
:rtype: int
.. py:function:: result_group(group_id, failures=False)
Returns the results of a task group