
This commit makes a set of small adjustments to examples. - Rework some of the comments to be more clear. - Add links to the original source tree file. - Rename some of the examples to make it clear the concept the example is intented to show. - Move some common example functionality to the example utility file. Change-Id: I858e0dbf72fe8cb40a05bfdbb0857720ffb71c7f
167 lines
3.5 KiB
ReStructuredText
167 lines
3.5 KiB
ReStructuredText
Making phone calls
|
|
==================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`simple_linear`.
|
|
|
|
.. literalinclude:: ../../taskflow/examples/simple_linear.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 16-29
|
|
|
|
Making phone calls (automatically reverting)
|
|
============================================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`reverting_linear`.
|
|
|
|
.. literalinclude:: ../../taskflow/examples/reverting_linear.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 17-26
|
|
|
|
Building a car
|
|
==============
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`build_a_car`.
|
|
|
|
.. literalinclude:: ../../taskflow/examples/build_a_car.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 22-28
|
|
|
|
Linear equation solver (explicit dependencies)
|
|
==============================================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`calculate_linear`.
|
|
|
|
.. literalinclude:: ../../taskflow/examples/calculate_linear.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 17-27
|
|
|
|
Linear equation solver (inferred dependencies)
|
|
==============================================
|
|
|
|
``Source:`` :example:`graph_flow.py`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/graph_flow.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 18-31
|
|
|
|
Linear equation solver (in parallel)
|
|
====================================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`calculate_in_parallel`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/calculate_in_parallel.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 18-21
|
|
|
|
Creating a volume (in parallel)
|
|
===============================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`create_parallel_volume`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/create_parallel_volume.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 21-23
|
|
|
|
Storing & emitting a bill
|
|
=========================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`fake_billing`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/fake_billing.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 24-32
|
|
|
|
Suspending a workflow & resuming
|
|
================================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`resume_from_backend`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/resume_from_backend.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 22-39
|
|
|
|
Creating a virtual machine (resumable)
|
|
======================================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`resume_vm_boot`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/resume_vm_boot.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 32-34
|
|
|
|
Creating a volume (resumable)
|
|
=============================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`resume_volume_create`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/resume_volume_create.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 28-30
|
|
|
|
Running engines via iteration
|
|
=============================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`run_by_iter`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/run_by_iter.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 24-27
|
|
|
|
Controlling retries using a retry controller
|
|
============================================
|
|
|
|
.. note::
|
|
|
|
Full source located at :example:`retry_flow`
|
|
|
|
.. literalinclude:: ../../taskflow/examples/retry_flow.py
|
|
:language: python
|
|
:linenos:
|
|
:lines: 16-
|
|
:emphasize-lines: 17-25
|