mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 20:48:12 +08:00
:docs: replaced some old redis references with brokers
This commit is contained in:
@@ -154,3 +154,7 @@ You can override this class if you want to contribute and support your own broke
|
|||||||
.. py:method:: info()
|
.. py:method:: info()
|
||||||
|
|
||||||
Shows the name and version of the currently configured broker.
|
Shows the name and version of the currently configured broker.
|
||||||
|
|
||||||
|
.. py:function:: brokers.get_broker()
|
||||||
|
|
||||||
|
Returns a :class:`Broker` instance based on the current configuration.
|
||||||
+1
-1
@@ -64,7 +64,7 @@ Only works with brokers that support delivery receipts. Defaults to 60 seconds.
|
|||||||
compress
|
compress
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
Compresses task packages to Redis. Useful for large payloads, but can add overhead when used with many small packages.
|
Compresses task packages to the broker. Useful for large payloads, but can add overhead when used with many small packages.
|
||||||
Defaults to ``False``
|
Defaults to ``False``
|
||||||
|
|
||||||
.. _save_limit:
|
.. _save_limit:
|
||||||
|
|||||||
+4
-4
@@ -171,13 +171,13 @@ Reference
|
|||||||
|
|
||||||
Returns true or false depending on any tasks still present in the task or result queue.
|
Returns true or false depending on any tasks still present in the task or result queue.
|
||||||
|
|
||||||
.. py:classmethod:: get(cluster_id, r=redis_client)
|
.. py:classmethod:: get(cluster_id, broker=None)
|
||||||
|
|
||||||
Gets the current :class:`Stat` for the cluster id. Takes an optional redis connection.
|
Gets the current :class:`Stat` for the cluster id. Takes an optional broker connection.
|
||||||
|
|
||||||
.. py:classmethod:: get_all(r=redis_client)
|
.. py:classmethod:: get_all(broker=None)
|
||||||
|
|
||||||
Returns a list of :class:`Stat` objects for all active clusters. Takes an optional redis connection.
|
Returns a list of :class:`Stat` objects for all active clusters. Takes an optional broker connection.
|
||||||
|
|
||||||
.. rubric:: Footnotes
|
.. rubric:: Footnotes
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -171,7 +171,7 @@ The task will then be injected straight into a worker and the result saved by a
|
|||||||
|
|
||||||
An error occurred: ImportError("No module named 'my'",)
|
An error occurred: ImportError("No module named 'my'",)
|
||||||
|
|
||||||
Note that :func:`async` will block until the task is executed and saved. This feature bypasses the Redis server and is intended for debugging and development.
|
Note that :func:`async` will block until the task is executed and saved. This feature bypasses the broker and is intended for debugging and development.
|
||||||
Instead of setting ``sync`` on each individual ``async`` you can also configure :ref:`sync` as a global override.
|
Instead of setting ``sync`` on each individual ``async`` you can also configure :ref:`sync` as a global override.
|
||||||
|
|
||||||
Connection pooling
|
Connection pooling
|
||||||
@@ -192,14 +192,14 @@ When you are making individual calls to :func:`async` a lot though, it can help
|
|||||||
|
|
||||||
.. tip::
|
.. tip::
|
||||||
|
|
||||||
If you are using `django-redis <https://github.com/niwinz/django-redis>`__ , you can :ref:`configure <django_redis>` Django Q to use its connection pool.
|
If you are using `django-redis <https://github.com/niwinz/django-redis>`__ and the redis broker, you can :ref:`configure <django_redis>` Django Q to use its connection pool.
|
||||||
|
|
||||||
|
|
||||||
Reference
|
Reference
|
||||||
---------
|
---------
|
||||||
|
|
||||||
.. py:function:: async(func, *args, hook=None, group=None, timeout=None,\
|
.. py:function:: async(func, *args, hook=None, group=None, timeout=None,\
|
||||||
save=None, sync=False, redis=None, q_options=None, **kwargs)
|
save=None, sync=False, broker=None, q_options=None, **kwargs)
|
||||||
|
|
||||||
Puts a task in the cluster queue
|
Puts a task in the cluster queue
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ Reference
|
|||||||
:param int timeout: Overrides global cluster :ref:`timeout`.
|
:param int timeout: Overrides global cluster :ref:`timeout`.
|
||||||
:param bool save: Overrides global save setting for this task.
|
:param bool save: Overrides global save setting for this task.
|
||||||
:param bool sync: If set to True, async will simulate a task execution
|
:param bool sync: If set to True, async will simulate a task execution
|
||||||
:param redis: Optional redis connection
|
:param broker: Optional broker connection from :func:`brokers.get_broker`
|
||||||
:param dict q_options: Options dict, overrides option keywords
|
:param dict q_options: Options dict, overrides option keywords
|
||||||
:param dict kwargs: Keyword arguments for the task function
|
:param dict kwargs: Keyword arguments for the task function
|
||||||
:returns: The uuid of the task
|
:returns: The uuid of the task
|
||||||
|
|||||||
Reference in New Issue
Block a user