Skip to content

Commit

Permalink
Add documentation for TaskGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed May 4, 2020
1 parent 08e5553 commit ea1693c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/6641.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some documentation around TaskGroups.
10 changes: 10 additions & 0 deletions docs/plugins/plugin-writer/concepts/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Tasks are deployed from Views or Viewsets, please see :ref:`kick-off-tasks`.
tasks/export


**Task Groups**

Sometimes you may want to create many tasks to perform different parts of one larger piece of work,
but you need a simple means to track the progress of these many tasks. Task Groups serve this purpose
by providing details on the number of associated tasks in each possible state. For more details,
please see :ref:`kick-off-tasks`.


Sync Pipeline
-------------

Expand All @@ -78,6 +86,8 @@ Sync Pipeline
sync_pipeline/sync_pipeline


.. _content-protection:

Content Protection
------------------

Expand Down
9 changes: 8 additions & 1 deletion docs/plugins/plugin-writer/concepts/subclassing/viewsets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Kick off Tasks
Some endpoints may need to deploy tasks to the tasking system. The following is an example of how
this is accomplished.

See :class:`~pulpcore.plugin.tasking.enqueue_with_reservation` for more details.

.. code-block:: python
# We recommend using POST for any endpoints that kick off task.
Expand Down Expand Up @@ -92,7 +94,12 @@ this is accomplished.
# Since tasks are asynchronous, we return a 202
return OperationPostponedResponse(result, request)
See :class:`~pulpcore.plugin.tasking.enqueue_with_reservation` for more details.
If a "task_group" is provided as an optional keyword argument, then the deployed task will be
automatically added to the task group. Once done spawning new tasks for a given task group,
you should call ``.finish()`` on the task group object.

For more details about the reservation system and task groups, see :ref:`writing-tasks`. and
:class:`~pulpcore.plugin.models.TaskGroup`.


Content Upload ViewSet
Expand Down

0 comments on commit ea1693c

Please sign in to comment.