Skip to content

Commit

Permalink
Deploying to master from @ endless4s/endless-transaction@cc294af 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
jchapuis committed Nov 19, 2024
1 parent 1afad4c commit 109e605
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 43 deletions.
6 changes: 3 additions & 3 deletions 2pc.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 0.3.0
<i class="md-icon" title="Version">label_outline</i> 0.4.0
</label>
</li>
</ul>
Expand Down Expand Up @@ -346,13 +346,13 @@ <h2><a href="#state-diagram" name="state-diagram" class="anchor"><span class="an
</ul></div>
</div>
<div>
<a href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/documentation/src/main/paradox/2pc.md" title="Edit this page" class="md-source-file md-edit">
<a href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/documentation/src/main/paradox/2pc.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
0.3.0
0.4.0
</span>
</div>
</article>
Expand Down
6 changes: 3 additions & 3 deletions abstractions.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 0.3.0
<i class="md-icon" title="Version">label_outline</i> 0.4.0
</label>
</li>
</ul>
Expand All @@ -181,13 +181,13 @@ <h1><a href="#abstractions" name="abstractions" class="anchor"><span class="anch
</ul>
</div>
<div>
<a href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/documentation/src/main/paradox/abstractions.md" title="Edit this page" class="md-source-file md-edit">
<a href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/documentation/src/main/paradox/abstractions.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
0.3.0
0.4.0
</span>
</div>
</article>
Expand Down
2 changes: 1 addition & 1 deletion api/lib/endless/transaction/Branch$.html

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions api/lib/endless/transaction/Branch.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
the effect type</p></dd><dt class="tparam">TID</dt><dd class="cmt"><p>
the transaction identifier type</p></dd><dt class="tparam">Q</dt><dd class="cmt"><p>
the query type</p></dd><dt class="tparam">R</dt><dd class="cmt"><p>
the abort reason type</p></dd></dl><div class="toggleContainer"><div class="toggle block"><span>Linear Supertypes</span><div class="superTypes hiddenContent"><span name="scala.AnyRef" class="extype">AnyRef</span>, <span name="scala.Any" class="extype">Any</span></div></div></div></div><div id="mbrsel"><div class="toggle"></div><div id="memberfilter"><i class="material-icons arrow"></i><span class="input"><input placeholder="Filter all members" id="mbrsel-input" type="text" accesskey="/"/></span><i class="clear material-icons"></i></div><div id="filterby"><div id="order"><span class="filtertype">Ordering</span><ol><li class="alpha in"><span>Alphabetic</span></li><li class="inherit out"><span>By Inheritance</span></li></ol></div><div class="ancestors"><span class="filtertype">Inherited<br/></span><ol id="linearization"><li class="in" name="endless.transaction.Branch"><span>Branch</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li></ol></div><div class="ancestors"><span class="filtertype"></span><ol><li class="hideall out"><span>Hide All</span></li><li class="showall in"><span>Show All</span></li></ol></div><div id="visbl"><span class="filtertype">Visibility</span><ol><li class="public in"><span>Public</span></li><li class="protected out"><span>Protected</span></li></ol></div></div></div><div id="template"><div id="allMembers"><div class="values members"><h3>Abstract Value Members</h3><ol><li class="indented0 " name="endless.transaction.Branch#abort" group="Ungrouped" fullComment="yes" data-isabs="true" visbl="pub"><a id="abort(id:TID):F[Unit]" class="anchorToMember"></a><a id="abort(TID):F[Unit]" class="anchorToMember"></a> <span class="permalink"><a href="../../endless/transaction/Branch.html#abort(id:TID):F[Unit]" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier">abstract </span> <span class="kind">def</span></span> <span class="symbol"><span class="name">abort</span><span class="params">(<span name="id">id: <span name="endless.transaction.Branch.TID" class="extype">TID</span></span>)</span><span class="result">: <span name="endless.transaction.Branch.F" class="extype">F</span>[<span name="scala.Unit" class="extype">Unit</span>]</span></span><p class="shortcomment cmt">Abort the transaction branch.</p><div class="fullcomment"><div class="comment cmt"><p>Abort the transaction branch. This is the second step in the 2PC protocol, in case of
the abort reason type</p></dd></dl><div class="toggleContainer"><div class="toggle block"><span>Linear Supertypes</span><div class="superTypes hiddenContent"><span name="scala.AnyRef" class="extype">AnyRef</span>, <span name="scala.Any" class="extype">Any</span></div></div></div></div><div id="mbrsel"><div class="toggle"></div><div id="memberfilter"><i class="material-icons arrow"></i><span class="input"><input placeholder="Filter all members" id="mbrsel-input" type="text" accesskey="/"/></span><i class="clear material-icons"></i></div><div id="filterby"><div id="order"><span class="filtertype">Ordering</span><ol><li class="alpha in"><span>Alphabetic</span></li><li class="inherit out"><span>By Inheritance</span></li></ol></div><div class="ancestors"><span class="filtertype">Inherited<br/></span><ol id="linearization"><li class="in" name="endless.transaction.Branch"><span>Branch</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li></ol></div><div class="ancestors"><span class="filtertype"></span><ol><li class="hideall out"><span>Hide All</span></li><li class="showall in"><span>Show All</span></li></ol></div><div id="visbl"><span class="filtertype">Visibility</span><ol><li class="public in"><span>Public</span></li><li class="protected out"><span>Protected</span></li></ol></div></div></div><div id="template"><div id="allMembers"><div class="values members"><h3>Abstract Value Members</h3><ol><li class="indented0 " name="endless.transaction.Branch#abort" group="Ungrouped" fullComment="yes" data-isabs="true" visbl="pub"><a id="abort(id:TID,reason:endless.transaction.Transaction.AbortReason[R]):F[Unit]" class="anchorToMember"></a><a id="abort(TID,AbortReason[R]):F[Unit]" class="anchorToMember"></a> <span class="permalink"><a href="../../endless/transaction/Branch.html#abort(id:TID,reason:endless.transaction.Transaction.AbortReason[R]):F[Unit]" title="Permalink"><i class="material-icons"></i></a></span> <span class="modifier_kind"><span class="modifier">abstract </span> <span class="kind">def</span></span> <span class="symbol"><span class="name">abort</span><span class="params">(<span name="id">id: <span name="endless.transaction.Branch.TID" class="extype">TID</span></span>, <span name="reason">reason: <a href="Transaction$$AbortReason.html" name="endless.transaction.Transaction.AbortReason" id="endless.transaction.Transaction.AbortReason" class="extype">AbortReason</a>[<span name="endless.transaction.Branch.R" class="extype">R</span>]</span>)</span><span class="result">: <span name="endless.transaction.Branch.F" class="extype">F</span>[<span name="scala.Unit" class="extype">Unit</span>]</span></span><p class="shortcomment cmt">Abort the transaction branch.</p><div class="fullcomment"><div class="comment cmt"><p>Abort the transaction branch. This is the second step in the 2PC protocol, in case of
preparation timeout or any branch voting to abort.
</p></div><dl class="paramcmts block"><dt class="param">id</dt><dd class="cmt"><p>
transaction id</p></dd></dl><dl class="attributes block"><dt>Note</dt><dd><span class="cmt"><p>
transaction id</p></dd><dt class="param">reason</dt><dd class="cmt"><p>
the reason for the abort</p></dd></dl><dl class="attributes block"><dt>Note</dt><dd><span class="cmt"><p>
all branches are expected to abort at this point, failure could lead to local inconsistency.
It's up to the branch to organize retries if necessary.</p></span>, <span class="cmt"><p>
this operation is expected to be idempotent, as it may be retried by the coordinator.</p></span>, <span class="cmt"><p>
Expand Down
2 changes: 1 addition & 1 deletion api/lib/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions branch.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 0.3.0
<i class="md-icon" title="Version">label_outline</i> 0.4.0
</label>
</li>
</ul>
Expand Down Expand Up @@ -214,13 +214,13 @@ <h2><a href="#abort" name="abort" class="anchor"><span class="anchor-link"></spa
<p>An exception raised in one of these operations transitions the transaction to failed state (once all branches return).</p></div>
</div>
<div>
<a href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/documentation/src/main/paradox/branch.md" title="Edit this page" class="md-source-file md-edit">
<a href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/documentation/src/main/paradox/branch.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
0.3.0
0.4.0
</span>
</div>
</article>
Expand Down
6 changes: 3 additions & 3 deletions coordinator.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 0.3.0
<i class="md-icon" title="Version">label_outline</i> 0.4.0
</label>
</li>
</ul>
Expand Down Expand Up @@ -192,13 +192,13 @@ <h1><a href="#coordinator" name="coordinator" class="anchor"><span class="anchor
<p>The <code>asResource</code> convenience implicit def will wrap the transaction instance into a <code>Resource</code>, with release leading to transaction abort if it is still pending (or a no-op if the transaction is already completed). </p></div>
</div>
<div>
<a href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/documentation/src/main/paradox/coordinator.md" title="Edit this page" class="md-source-file md-edit">
<a href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/documentation/src/main/paradox/coordinator.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
0.3.0
0.4.0
</span>
</div>
</article>
Expand Down
12 changes: 6 additions & 6 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 0.3.0
<i class="md-icon" title="Version">label_outline</i> 0.4.0
</label>
</li>
</ul>
Expand Down Expand Up @@ -238,7 +238,7 @@ <h2><a href="#transfers" name="transfers" class="anchor"><span class="anchor-lin
<p>Transfers are implemented using an <code>endless-transaction</code> transaction coordinator. </p>
<h3><a href="#coordinator" name="coordinator" class="anchor"><span class="anchor-link"></span></a>Coordinator</h3>
<p>A coordinator is created with <code>TransferID</code> as the transaction identifier type, <code>AccountID</code> as the branch identifier, <code>Transfer</code> as the query payload (the amount, origin, and destination), and <code>TransferFailure</code> as the error coproduct.</p>
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/example/src/main/scala/endless/transaction/example/logic/ShardedAccounts.scala#L65-L72" target="_blank" title="Go to snippet source">source</a><code class="language-scala">transactor.coordinator[TransferID, AccountID, Transfer, TransferFailure](
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/example/src/main/scala/endless/transaction/example/logic/ShardedAccounts.scala#L65-L72" target="_blank" title="Go to snippet source">source</a><code class="language-scala">transactor.coordinator[TransferID, AccountID, Transfer, TransferFailure](
&quot;transfer&quot;,
{ accountID =&gt;
val account = sharding.entityFor(accountID)
Expand All @@ -249,7 +249,7 @@ <h3><a href="#coordinator" name="coordinator" class="anchor"><span class="anchor
<p>The coordinator is used in the implementation of the <code>transfer</code> method in <code>ShardedAccounts</code>, i.e. the implementation of <code>Accounts</code>. </p>
<h3><a href="#transaction" name="transaction" class="anchor"><span class="anchor-link"></span></a>Transaction</h3>
<p>The snippet below shows the logic: the code creates a transfer with two branches, one for the origin account, and the other for the destination account.</p>
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/example/src/main/scala/endless/transaction/example/logic/ShardedAccounts.scala#L29-L50" target="_blank" title="Go to snippet source">source</a><code class="language-scala">def transfer(from: AccountID, to: AccountID, amount: PosAmount): F[TransferFailure \/ Unit] =
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/example/src/main/scala/endless/transaction/example/logic/ShardedAccounts.scala#L29-L50" target="_blank" title="Go to snippet source">source</a><code class="language-scala">def transfer(from: AccountID, to: AccountID, amount: PosAmount): F[TransferFailure \/ Unit] =
coordinator
.create(TransferID.random, Transfer(from, to, amount), from, to)
.asResource
Expand All @@ -275,7 +275,7 @@ <h3><a href="#transaction" name="transaction" class="anchor"><span class="anchor
<p>To implement this polling operation, we use the <code>pollForFinalStatus()</code> built-in extension method (defined for <code>Transaction</code>): this method retrieves the status of the transaction at configurable intervals and semantically sleeps in between.</p>
<h3><a href="#branch" name="branch" class="anchor"><span class="anchor-link"></span></a>Branch</h3>
<p>An account&rsquo;s involvement in a transfer is described by <code>TransferBranch</code>, as exemplified below with the implementation of the <code>prepare</code> method: </p>
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/example/src/main/scala/endless/transaction/example/logic/TransferBranch.scala#L21-L66" target="_blank" title="Go to snippet source">source</a><code class="language-scala">class TransferBranch[F[_]: Logger](accountID: AccountID, account: Account[F])(implicit
<pre class="prettyprint"><button class="snippet-button copy-snippet" title="Copy snippet to clipboard">copy</button><a class="snippet-button go-to-source" href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/example/src/main/scala/endless/transaction/example/logic/TransferBranch.scala#L22-L67" target="_blank" title="Go to snippet source">source</a><code class="language-scala">class TransferBranch[F[_]: Logger](accountID: AccountID, account: Account[F])(implicit
retryParameters: TransferParameters.BranchRetryParameters,
temporal: Temporal[F]
) extends Branch[F, TransferID, Transfer, TransferFailure] {
Expand Down Expand Up @@ -323,13 +323,13 @@ <h3><a href="#branch" name="branch" class="anchor"><span class="anchor-link"></s
}</code></pre>
</div>
<div>
<a href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/documentation/src/main/paradox/example.md" title="Edit this page" class="md-source-file md-edit">
<a href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/documentation/src/main/paradox/example.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
0.3.0
0.4.0
</span>
</div>
</article>
Expand Down
8 changes: 4 additions & 4 deletions getting-started.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 0.3.0
<i class="md-icon" title="Version">label_outline</i> 0.4.0
</label>
</li>
</ul>
Expand All @@ -172,20 +172,20 @@
<div class="md-content__searchable">
<h1><a href="#getting-started" name="getting-started" class="anchor"><span class="anchor-link"></span></a>Getting Started</h1>
<p>Add the following dependency to your <code>build.sbt</code> file:</p>
<pre class="prettyprint"><code class="language-scala">libraryDependencies += &quot;io.github.endless4s&quot; %% &quot;endless-transaction&quot; % &quot;0.3.0&quot;
<pre class="prettyprint"><code class="language-scala">libraryDependencies += &quot;io.github.endless4s&quot; %% &quot;endless-transaction&quot; % &quot;0.4.0&quot;
</code></pre>
<p>This will pull in the module containing the abstractions. You should add this dependency to the project that contains your business domain logic (typically &ldquo;domain&rdquo;).</p>
<p>The Pekko runtime is available in <code>endless-transaction-pekko</code> and provides <code>PekkoTransactor</code>, an implementation of <code>Transactor</code> which is the entry-point to create a transaction coordinator (for Akka, use <code>endless-transaction-akka</code>). </p><div class="callout warning "><div class="callout-title">Compatibility</div>
<p>Since Pekko/Akka <a href="https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed">do not allow mixed versions</a> in a project, dependencies of <code>endless-transaction-pekko</code> (and <code>endless-transaction-akka</code> respectively) are marked a <code>Provided</code>. This means that your application <code>libraryDependencies</code> needs to directly include Pekko or Akka as a direct dependency. The minimal supported Pekko version is 1.1.2, and Akka version is 2.6.20. </p></div>
</div>
<div>
<a href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/documentation/src/main/paradox/getting-started.md" title="Edit this page" class="md-source-file md-edit">
<a href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/documentation/src/main/paradox/getting-started.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
0.3.0
0.4.0
</span>
</div>
</article>
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<ul style="display: none">
<li class="md-nav__item md-version" id="project.version">
<label class="md-nav__link" for="__version">
<i class="md-icon" title="Version">label_outline</i> 0.3.0
<i class="md-icon" title="Version">label_outline</i> 0.4.0
</label>
</li>
</ul>
Expand All @@ -174,13 +174,13 @@
</div>
</div>
<div>
<a href="https://github.com/endless4s/endless-transaction/tree/v0.3.0/documentation/src/main/paradox/index.md" title="Edit this page" class="md-source-file md-edit">
<a href="https://github.com/endless4s/endless-transaction/tree/v0.4.0/documentation/src/main/paradox/index.md" title="Edit this page" class="md-source-file md-edit">
Edit this page
</a>
</div>
<div class="print-only">
<span class="md-source-file md-version">
0.3.0
0.4.0
</span>
</div>
</article>
Expand Down
Loading

0 comments on commit 109e605

Please sign in to comment.