diff --git a/docs/brokers.rst b/docs/brokers.rst index 8bf4db6..1d12c42 100644 --- a/docs/brokers.rst +++ b/docs/brokers.rst @@ -154,3 +154,7 @@ You can override this class if you want to contribute and support your own broke .. py:method:: info() 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. \ No newline at end of file diff --git a/docs/configure.rst b/docs/configure.rst index 8a3d17e..1795670 100644 --- a/docs/configure.rst +++ b/docs/configure.rst @@ -64,7 +64,7 @@ Only works with brokers that support delivery receipts. Defaults to 60 seconds. 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`` .. _save_limit: diff --git a/docs/monitor.rst b/docs/monitor.rst index 3dbf937..1e8b655 100644 --- a/docs/monitor.rst +++ b/docs/monitor.rst @@ -171,13 +171,13 @@ Reference 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 diff --git a/docs/tasks.rst b/docs/tasks.rst index b1abdb3..5da69c1 100644 --- a/docs/tasks.rst +++ b/docs/tasks.rst @@ -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'",) -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. Connection pooling @@ -192,14 +192,14 @@ When you are making individual calls to :func:`async` a lot though, it can help .. tip:: - If you are using `django-redis `__ , you can :ref:`configure ` Django Q to use its connection pool. + If you are using `django-redis `__ and the redis broker, you can :ref:`configure ` Django Q to use its connection pool. Reference --------- .. 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 @@ -210,7 +210,7 @@ Reference :param int timeout: Overrides global cluster :ref:`timeout`. :param bool save: Overrides global save setting for this task. :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 kwargs: Keyword arguments for the task function :returns: The uuid of the task