-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed b7e6c02 with MkDocs version: 1.5.3
- Loading branch information
Unknown
committed
Nov 20, 2023
0 parents
commit 51acfcf
Showing
43 changed files
with
9,800 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="shortcut icon" href="/img/favicon.ico" /> | ||
<title>Pipeline Views</title> | ||
<link rel="stylesheet" href="/css/theme.css" /> | ||
<link rel="stylesheet" href="/css/theme_extra.css" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" /> | ||
<link href="/css/docs.css" rel="stylesheet" /> | ||
|
||
<!--[if lt IE 9]> | ||
<script src="/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/python.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/console.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/json.min.js"></script> | ||
<script>hljs.highlightAll();</script> | ||
</head> | ||
|
||
<body class="wy-body-for-nav" role="document"> | ||
|
||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search"> | ||
<a href="/." class="icon icon-home"> Pipeline Views | ||
</a><div role="search"> | ||
<form id ="rtd-search-form" class="wy-form" action="//search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" /> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/.">Home</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/quickstart/">Quickstart</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/inference/">Serializer Inference</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/logic_blocks/">Logic Blocks</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/conditionals/">Conditional Logic Paths</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/async/">Async Logic Callables</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/schema/">OpenAPI Schema</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/metadata/">Metadata</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="/misc/">Miscellaneous</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> | ||
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu"> | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="/.">Pipeline Views</a> | ||
|
||
</nav> | ||
<div class="wy-nav-content"> | ||
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href="/." class="icon icon-home" aria-label="Docs"></a></li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div class="section" itemprop="articleBody"> | ||
|
||
|
||
<h1 id="404-page-not-found">404</h1> | ||
|
||
<p><strong>Page not found</strong></p> | ||
|
||
|
||
</div> | ||
</div><footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<!-- Copyright etc --> | ||
</div> | ||
|
||
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
</footer> | ||
|
||
</div> | ||
</div> | ||
|
||
</section> | ||
|
||
</div> | ||
|
||
<div class="rst-versions" role="note" aria-label="Versions"> | ||
<span class="rst-current-version" data-toggle="rst-current-version"> | ||
|
||
|
||
|
||
</span> | ||
</div> | ||
<script src="/js/jquery-3.6.0.min.js"></script> | ||
<script>var base_url = "/";</script> | ||
<script src="/js/theme_extra.js"></script> | ||
<script src="/js/theme.js"></script> | ||
<script src="/search/main.js"></script> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="shortcut icon" href="../img/favicon.ico" /> | ||
<title>Async Logic Callables - Pipeline Views</title> | ||
<link rel="stylesheet" href="../css/theme.css" /> | ||
<link rel="stylesheet" href="../css/theme_extra.css" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" /> | ||
<link href="../css/docs.css" rel="stylesheet" /> | ||
|
||
<script> | ||
// Current page data | ||
var mkdocs_page_name = "Async Logic Callables"; | ||
var mkdocs_page_input_path = "async.md"; | ||
var mkdocs_page_url = null; | ||
</script> | ||
|
||
<!--[if lt IE 9]> | ||
<script src="../js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/python.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/console.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/json.min.js"></script> | ||
<script>hljs.highlightAll();</script> | ||
</head> | ||
|
||
<body class="wy-body-for-nav" role="document"> | ||
|
||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search"> | ||
<a href=".." class="icon icon-home"> Pipeline Views | ||
</a><div role="search"> | ||
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" /> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="..">Home</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../quickstart/">Quickstart</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../inference/">Serializer Inference</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../logic_blocks/">Logic Blocks</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../conditionals/">Conditional Logic Paths</a> | ||
</li> | ||
</ul> | ||
<ul class="current"> | ||
<li class="toctree-l1 current"><a class="reference internal current" href="./">Async Logic Callables</a> | ||
<ul class="current"> | ||
</ul> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../schema/">OpenAPI Schema</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../metadata/">Metadata</a> | ||
</li> | ||
</ul> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../misc/">Miscellaneous</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> | ||
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu"> | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="..">Pipeline Views</a> | ||
|
||
</nav> | ||
<div class="wy-nav-content"> | ||
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href=".." class="icon icon-home" aria-label="Docs"></a></li> | ||
<li class="breadcrumb-item active">Async Logic Callables</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div class="section" itemprop="articleBody"> | ||
|
||
<h1 id="async-logic-callables">Async Logic Callables</h1> | ||
<p>Pipeline logic callables can also be coroutines. | ||
The best part about coroutines is that they can be run in parallel. | ||
You parallel execution in a pipeline easily with a tuple, i.e., a <code>parallel block</code>.</p> | ||
<pre class="highlight"><code class="language-python">async def async_step1(...): | ||
... | ||
|
||
async def async_step2_1(...): | ||
... | ||
|
||
async def async_step2_2(...): | ||
... | ||
|
||
async def async_step3(...): | ||
...</code></pre> | ||
<pre class="highlight"><code class="language-python">from pipeline_views import BasePipelineView | ||
from .services import async_step1, async_step2_1, async_step2_2, async_step3 | ||
|
||
|
||
class SomeView(BasePipelineView): | ||
|
||
pipelines = { | ||
"GET": [ | ||
async_step1, | ||
( | ||
async_step2_1, | ||
async_step2_2, | ||
), | ||
async_step3, | ||
], | ||
}</code></pre> | ||
<p>Now <code>async_step2_1</code> and <code>async_step2_2</code> will be executed in parallel, and will both receive all the | ||
arguments from <code>async_step1</code>. <code>async_step2_1</code> and <code>async_step2_2</code> should return dictionaries like standard | ||
pipeline logic methods. <code>async_step3</code> will then receive a union of the results of these coroutines. | ||
If the return dictionaries of the two coroutines have any common keys, the value from the coroutine defined last | ||
in the parallel block will be used.</p> | ||
<p>Return values from the callable before the parallel excecution can be passed to the next step after the | ||
parallel execution by setting <code>...</code> (ellipses) in the tuple. If there are any common keys in this case, | ||
the values from the logic block will be prioritized.</p> | ||
<pre class="highlight"><code class="language-python">from pipeline_views import BasePipelineView | ||
from .services import async_step1, async_step2_1, async_step2_2, async_step3 | ||
|
||
|
||
class SomeView(BasePipelineView): | ||
|
||
pipelines = { | ||
"GET": [ | ||
async_step1, | ||
( | ||
async_step2_1, | ||
async_step2_2, | ||
... | ||
), | ||
async_step3, | ||
], | ||
}</code></pre> | ||
|
||
</div> | ||
</div><footer> | ||
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation"> | ||
<a href="../conditionals/" class="btn btn-neutral float-left" title="Conditional Logic Paths"><span class="icon icon-circle-arrow-left"></span> Previous</a> | ||
<a href="../schema/" class="btn btn-neutral float-right" title="OpenAPI Schema">Next <span class="icon icon-circle-arrow-right"></span></a> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<!-- Copyright etc --> | ||
</div> | ||
|
||
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
</footer> | ||
|
||
</div> | ||
</div> | ||
|
||
</section> | ||
|
||
</div> | ||
|
||
<div class="rst-versions" role="note" aria-label="Versions"> | ||
<span class="rst-current-version" data-toggle="rst-current-version"> | ||
|
||
|
||
<span><a href="../conditionals/" style="color: #fcfcfc">« Previous</a></span> | ||
|
||
|
||
<span><a href="../schema/" style="color: #fcfcfc">Next »</a></span> | ||
|
||
</span> | ||
</div> | ||
<script src="../js/jquery-3.6.0.min.js"></script> | ||
<script>var base_url = "..";</script> | ||
<script src="../js/theme_extra.js"></script> | ||
<script src="../js/theme.js"></script> | ||
<script src="../search/main.js"></script> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.