continuable/changelog.html
2018-03-17 13:27:07 +01:00

187 lines
18 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-115514125-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-115514125-1');
</script>
<meta charset="UTF-8" />
<title>Changelog | Continuable</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="base.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="terminal.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="atom-one-dark.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#23373B" />
</head>
<body>
<header><nav id="navigation">
<div class="m-container">
<div class="m-row">
<a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">Continuable <span class="m-thin">3.0.0</span></a>
<div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
<a href="#search" class="m-dox-search-icon" title="Search" onclick="return showSearch()"><svg viewBox="0 0 16 16">
<path d="m6 0c-3.3144 0-6 2.6856-6 6 0 3.3144 2.6856 6 6 6 1.4858 0 2.8463-0.54083 3.8945-1.4355-0.0164 0.33797 0.14734 0.75854 0.5 1.1504l3.2227 3.7891c0.55185 0.6139 1.4517 0.66544 2.002 0.11524 0.55022-0.55022 0.49866-1.4501-0.11524-2.002l-3.7891-3.2246c-0.39184-0.35266-0.81242-0.51469-1.1504-0.5 0.89472-1.0482 1.4355-2.4088 1.4355-3.8945 0-3.3128-2.6856-5.998-6-5.998zm0 1.5625a4.4375 4.4375 0 0 1 4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375-4.4375 4.4375 4.4375 0 0 1 4.4375-4.4375z"/>
</svg></a>
<a id="m-navbar-show" href="#navigation" title="Show navigation"></a>
<a id="m-navbar-hide" href="#" title="Hide navigation"></a>
</div>
<div id="m-navbar-collapse" class="m-col-t-12 m-show-m m-col-m-none m-right-m">
<div class="m-row">
<ol class="m-col-t-6 m-col-m-none">
<li>
<a href="tutorial.html">Tutorial</a>
<ol>
<li><a href="tutorial-creating-continuables.html">Creating continuables</a></li>
<li><a href="tutorial-chaining-continuables.html">Chaining continuables</a></li>
<li><a href="tutorial-connecting-continuables.html">Connecting continuables</a></li>
<li><a href="tutorial-transforming-continuables.html">Transforming continuables</a></li>
<li><a href="tutorial-awaiting-continuables.html">Awaiting continuables</a></li>
<li><a href="tutorial-promisify-continuables.html">Promisify functions</a></li>
</ol>
</li>
<li>
<a href="pages.html">Pages</a>
<ol>
<li><a href="installation.html">Installation</a></li>
<li><a href="tutorial.html">Tutorial</a></li>
<li><a href="configuration.html">Configuration</a></li>
<li><a href="changelog.html" id="m-navbar-current">Changelog</a></li>
</ol>
</li>
<li>
<a href="modules.html">Modules</a>
<ol>
<li><a href="group___base.html">Base</a></li>
<li><a href="group___connections.html">Connections</a></li>
<li><a href="group___promisify.html">Promisify</a></li>
<li><a href="group___testing.html">Testing</a></li>
<li><a href="group___types.html">Types</a></li>
<li><a href="group___transforms.html">Transforms</a></li>
<li><a href="group___traversal.html">Traversal</a></li>
</ol>
</li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="4">
<li>
<a href="namespacecti.html">cti</a>
<ol>
<li><a href="namespacecti_1_1transforms.html">cti::transforms</a></li>
<li><a href="classcti_1_1continuable__base.html">cti::continuable_base</a></li>
<li><a href="classcti_1_1promise__base.html">cti::promise_base</a></li>
</ol>
</li>
<li class="m-show-m"><a href="#search" class="m-dox-search-icon" title="Search" onclick="return showSearch()"><svg viewBox="0 0 16 16">
<path d="m6 0c-3.3144 0-6 2.6856-6 6 0 3.3144 2.6856 6 6 6 1.4858 0 2.8463-0.54083 3.8945-1.4355-0.0164 0.33797 0.14734 0.75854 0.5 1.1504l3.2227 3.7891c0.55185 0.6139 1.4517 0.66544 2.002 0.11524 0.55022-0.55022 0.49866-1.4501-0.11524-2.002l-3.7891-3.2246c-0.39184-0.35266-0.81242-0.51469-1.1504-0.5 0.89472-1.0482 1.4355-2.4088 1.4355-3.8945 0-3.3128-2.6856-5.998-6-5.998zm0 1.5625a4.4375 4.4375 0 0 1 4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375-4.4375 4.4375 4.4375 0 0 1 4.4375-4.4375z"/>
</svg> Search</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none">
<li>
<a href="https://github.com/Naios/continuable" aria-label="View source on Github"><i class="fa fa-github"></i> Code</a>
</li>
</ol>
</div>
</div>
</div>
</div>
</nav></header>
<main><article>
<div class="m-container m-container-inflatable">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<h1>
Changelog
</h1>
<p>A description of the changes made to continuable.</p>
<section id="changelog-versions"><h2><a href="#changelog-versions">Versions</a></h2><p>Following versions were released:</p><section id="changelog-versions-3-0-0"><h3><a href="#changelog-versions-3-0-0">3.0.0</a></h3><p><strong>New helper functions</strong></p><p>New helper functions were added to create ready continuables:</p><ul><li><a href="group___base.html#gaa638513fe4c0a80b9ad445f8dff91250" class="m-dox">make_<wbr />ready_<wbr />continuable</a></li><li><a href="group___base.html#ga41794c321aef916f4fd0fe4c36aa9e6e" class="m-dox">make_<wbr />exceptional_<wbr />continuable</a></li></ul><p><strong>Improvements to connections</strong></p><p>The implementation of connections were rewritten entirely. It is possible now to connect runtime sized containers as well as deeply nested sequences. See tutorial-connections for details.</p><p>Additionally connection overloads were added that accept two iterators in order to come closer to the interface of the standard library.</p><p>Also <a href="group___connections.html#ga4f6ecedf4b4ccd5e1c28d937ad717b32" class="m-dox">populate</a> was added which makes it possible to populate a dynamic container from <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</p><p><strong>Disabled copies for promises and continuables entirely</strong></p><p>The <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> and <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is now non copyable. This change should make it easier to work with the move only semantic of continuables in order to make less mistakes.</p><p><strong>Traversal API</strong></p><p>A new traversal API for synchronous and asynchronous pack traversal was added which makes it easy to specify new connection types.</p></section><section id="changelog-versions-2-0-0"><h3><a href="#changelog-versions-2-0-0">2.0.0</a></h3><p><strong>Error handling</strong></p><p>Usually it is inconvenient to handle error codes and exceptions in an asynchronous context, as we all know <code>std::future</code> supports error handling through exceptions already. We now introduce this capability to the continuable library while allowing error codes to be used as well.</p><p>Consider the function <code><a href="group___types.html#ga7c8df37fa79b1da94a876e8fc590783c" class="m-dox">cti::<wbr />continuable</a>&lt;&gt; get_bad_continuable()</code> which always resolves through an error, then you may handle the error code or exception as following:</p><pre class="m-code"><span class="n">get_bad_continuable</span><span class="p">()</span>
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">{</span>
<span class="c1">// ... never invoked</span>
<span class="p">})</span>
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">{</span>
<span class="c1">// ... never invoked as well</span>
<span class="p">})</span>
<span class="p">.</span><span class="n">fail</span><span class="p">([]</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception_ptr</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
<span class="k">try</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">rethrow_exception</span><span class="p">(</span><span class="n">e</span><span class="p">);</span>
<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span> <span class="k">const</span><span class="o">&amp;</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// Handle the exception here</span>
<span class="p">}</span>
<span class="p">});</span></pre><p><strong>Abstracting callbacks as promises</strong></p><p>Since a callback may be called through an error or result the cri::promise class was added in order ro provide a similar interface to std::promise:</p><pre class="m-code"><span class="k">auto</span> <span class="nf">http_request</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">url</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">&gt;</span><span class="p">(</span>
<span class="p">[</span><span class="n">url</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">url</span><span class="p">)](</span><span class="n">cti</span><span class="o">::</span><span class="n">promise</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">&gt;</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// Perform the actual request through a different library,</span>
<span class="c1">// resolve the promise upon completion of the task.</span>
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="s">&quot;&lt;html&gt; ... &lt;/html&gt;&quot;</span><span class="p">);</span>
<span class="c1">// ...or promise.set_exception(...);</span>
<span class="p">});</span>
<span class="p">}</span></pre><p><strong><code>co_await</code> support</strong></p><p>Experimental coroutine (<code>co_await</code> and <code>co_return</code>) support was added, this is available on MSVC 2017 and Clang 5.0.</p><pre class="m-code"><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="n">co_await</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span><span class="p">([](</span><span class="k">auto</span><span class="o">&amp;&amp;</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<span class="p">});</span></pre><p><strong>Minor improvements</strong></p><p>The library was improved in other ways:</p><ul><li><code>constexpr</code> and <code>noexcept</code> improvements</li><li>Compile-time improvements</li><li>Documentation improvements</li></ul><p><strong>Header split</strong></p><p>Since the overall library size was increased the headers were split into smaller chunks.</p></section><section id="changelog-versions-1-0-0"><h3><a href="#changelog-versions-1-0-0">1.0.0</a></h3><ul><li>Documentation and readme changes</li><li>Change the assertion type of some GTest macros from expected to assertion.</li></ul></section><section id="changelog-versions-0-8-0"><h3><a href="#changelog-versions-0-8-0">0.8.0 (unstable)</a></h3><ul><li>Fixes a major issue with handling the ownership for consumed continuables which led to unintended invocations.</li><li><p>Adds partial application support which makes it possible to chain callbacks which accept less arguments then the curret signature.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">&quot;github.com&quot;</span><span class="p">)</span>
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">{</span>
<span class="c1">// ...</span>
<span class="p">});</span></pre></li><li><p>Adds Support for sequential invocation:</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">&quot;github.com&quot;</span><span class="p">)</span> <span class="o">&gt;&gt;</span> <span class="n">http_request</span><span class="p">(</span><span class="s">&quot;atom.io&quot;</span><span class="p">)</span>
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// ...</span>
<span class="p">});</span></pre></li></ul></section><section id="changelog-versions-0-7-0"><h3><a href="#changelog-versions-0-7-0">0.7.0 (unstable)</a></h3><ul><li>Continuation syntactic sugar</li><li>Executor support</li><li>Connection support</li></ul></section></section><section id="changelog-semver"><h2><a href="#changelog-semver">Semantic versioning and stability</a></h2><p>Continuable strictly follows the rules of <a href="http://semver.org/">semantic versioning</a>, the API is kept stable across minor versions.</p><p>The CI driven unit-tests are observed through the Clang sanitizers (asan, ubsan and lsan - when compiling with Clang) or Valgrind (when compiling with GCC) in order to prevent regressions.</p></section>
</div>
</div>
</div>
</article></main>
<div class="m-dox-search" id="search">
<a href="#!" onclick="return hideSearch()"></a>
<div class="m-container">
<div class="m-row">
<div class="m-col-m-8 m-push-m-2">
<div class="m-dox-search-header m-text m-small">
<div><span class="m-label m-default">Tab</span> / <span class="m-label m-default">T</span> to search, <span class="m-label m-default">Esc</span> to close</div>
<div id="search-symbolcount">&hellip;</div>
</div>
<div class="m-dox-search-content">
<input type="search" id="search-input" placeholder="Loading &hellip;" disabled="disabled" autofocus="autofocus" />
<noscript class="m-text m-danger m-text-center">Unlike everything else in the docs, the search functionality <em>requires</em> JavaScript.</noscript>
<div id="search-help" class="m-text m-dim m-text-center">
Search for symbols, directories, files, pages or modules. You can omit any
prefix from the symbol or file path; adding a <code>:</code> or <code>/</code>
suffix lists all members of given symbol or directory. Navigate through the
list using <span class="m-label m-dim">&darr;</span> and
<span class="m-label m-dim">&uarr;</span>, press
<span class="m-label m-dim">Enter</span> to go.
</div>
<div id="search-notfound" class="m-text m-warning m-text-center">Sorry, nothing was found.</div>
<ul id="search-results"></ul>
</div>
</div>
</div>
</div>
</div>
<script src="search.js"></script>
<script src="searchdata.js" async="async"></script>
<footer><nav>
<div class="m-container">
<div class="m-row">
<div class="m-col-l-10 m-push-l-1">
<b><a href="https://github.com/Naios/continuable">continuable</a></b> - C++14 allocation aware futures</br>Copyright 2015&ndash;2018 <a href="https://github.com/Naios">Denis Blank</a>. Contact the author via <a href="mailto:denis.blank@outlook.com">e-mail</a>.</br>Powered by <a href="http://doxygen.org/">Doxygen</a> and <a href="http://mcss.mosra.cz/">m.css</a>
</div>
</div>
</div>
</nav></footer>
</body>
</html>