Skip to content

Commit

Permalink
Deploying to master from @ endless4s/endless-transaction@140dd35 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
jchapuis committed Oct 23, 2024
1 parent 040a045 commit 1afad4c
Show file tree
Hide file tree
Showing 36 changed files with 105 additions and 72 deletions.
41 changes: 36 additions & 5 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.2.0
<i class="md-icon" title="Version">label_outline</i> 0.3.0
</label>
</li>
</ul>
Expand Down Expand Up @@ -256,8 +256,39 @@ <h2><a href="#commit" name="commit" class="anchor"><span class="anchor-link"></s
<th>Transaction branch operation </th>
</tr>
</thead>
</table>
<p>| Do nothing: reservations were already made | External API | - | | Do nothing: the guarantee charge was already made | Internal service | - | | Update customer details in the internal database | Database | Perform the row update and unlock | | Update the &ldquo;recent bookings&rdquo; cache and release the semaphore | In-memory resource | Edit and unlock an in-memory resource | | Do nothing: the reminder notifications were already scheduled | Actor cluster | - | | Do nothing: the bookings log was already updated | File | - |</p><div class="callout note "><div class="callout-title">Commit consistency</div>
<tbody>
<tr>
<td>Do nothing: reservations were already made </td>
<td>External API </td>
<td>nop </td>
</tr>
<tr>
<td>Do nothing: the guarantee charge was already made </td>
<td>Internal service </td>
<td>nop </td>
</tr>
<tr>
<td>Update customer details in the internal database </td>
<td>Database </td>
<td>Perform the row update and unlock </td>
</tr>
<tr>
<td>Update the &ldquo;recent bookings&rdquo; cache and release the semaphore </td>
<td>In-memory resource </td>
<td>Edit and unlock an in-memory resource </td>
</tr>
<tr>
<td>Do nothing: the reminder notifications were already scheduled </td>
<td>Actor cluster </td>
<td>nop </td>
</tr>
<tr>
<td>Do nothing: the bookings log was already updated </td>
<td>File </td>
<td>nop </td>
</tr>
</tbody>
</table><div class="callout note "><div class="callout-title">Commit consistency</div>
<p>It&rsquo;s up to the implementer to decide the level of consistency in the execution of the commit. Transaction failure is also valid and can be signaled by raising an exception in the target effect. Failure will lead to inconsistency in the overall system state, which can be an acceptable compromise in some use cases.</p>
<p>For instance, in our imaginary example, the &ldquo;in-memory cache&rdquo; could be locked only briefly to preserve throughput. Because it&rsquo;s optional to the journey process, updating it could be skipped in case of delays. On the other hand, if the &ldquo;internal database&rdquo; update still fails despite the lock, the commit expression could signal this by raising an exception. The exception would conclude the transaction in a failed state, allowing surfacing in the UI for manual remediation.</p></div>
<h2><a href="#abort" name="abort" class="anchor"><span class="anchor-link"></span></a>Abort</h2>
Expand Down Expand Up @@ -315,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.2.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.3.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.2.0
0.3.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.2.0
<i class="md-icon" title="Version">label_outline</i> 0.3.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.2.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.3.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.2.0
0.3.0
</span>
</div>
</article>
Expand Down

This file was deleted.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/lib/endless/transaction/Coordinator$.html

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions api/lib/endless/transaction/Coordinator.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@
the transaction identifier type</p></dd><dt class="tparam">BID</dt><dd class="cmt"><p>
the branch 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.Coordinator"><span>Coordinator</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.Coordinator#create" group="Ungrouped" fullComment="yes" data-isabs="true" visbl="pub"><a id="create(id:TID,query:Q,branch:BID,otherBranches:BID*):cats.effect.kernel.Resource[F,endless.transaction.Transaction[F,BID,Q,R]]" class="anchorToMember"></a><a id="create(TID,Q,BID,BID*):Resource[F,Transaction[F,BID,Q,R]]" class="anchorToMember"></a> <span class="permalink"><a href="../../endless/transaction/Coordinator.html#create(id:TID,query:Q,branch:BID,otherBranches:BID*):cats.effect.kernel.Resource[F,endless.transaction.Transaction[F,BID,Q,R]]" 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">create</span><span class="params">(<span name="id">id: <span name="endless.transaction.Coordinator.TID" class="extype">TID</span></span>, <span name="query">query: <span name="endless.transaction.Coordinator.Q" class="extype">Q</span></span>, <span name="branch">branch: <span name="endless.transaction.Coordinator.BID" class="extype">BID</span></span>, <span name="otherBranches">otherBranches: <span name="endless.transaction.Coordinator.BID" class="extype">BID</span>*</span>)</span><span class="result">: <span name="cats.effect.kernel.Resource" class="extype">Resource</span>[<span name="endless.transaction.Coordinator.F" class="extype">F</span>, <a href="Transaction.html" name="endless.transaction.Transaction" id="endless.transaction.Transaction" class="extype">Transaction</a>[<span name="endless.transaction.Coordinator.F" class="extype">F</span>, <span name="endless.transaction.Coordinator.BID" class="extype">BID</span>, <span name="endless.transaction.Coordinator.Q" class="extype">Q</span>, <span name="endless.transaction.Coordinator.R" class="extype">R</span>]]</span></span><p class="shortcomment cmt">Creates a new transaction with the given id, query and branches, and returns a handle to it
wrapped in a <code>Resource</code>.</p><div class="fullcomment"><div class="comment cmt"><p>Creates a new transaction with the given id, query and branches, and returns a handle to it
wrapped in a <code>Resource</code>. Resource release leads to transaction abort if it is still pending
(or a no-op if the transaction is already completed).
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.Coordinator"><span>Coordinator</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.Coordinator#create" group="Ungrouped" fullComment="yes" data-isabs="true" visbl="pub"><a id="create(id:TID,query:Q,branch:BID,otherBranches:BID*):F[endless.transaction.Transaction[F,BID,Q,R]]" class="anchorToMember"></a><a id="create(TID,Q,BID,BID*):F[Transaction[F,BID,Q,R]]" class="anchorToMember"></a> <span class="permalink"><a href="../../endless/transaction/Coordinator.html#create(id:TID,query:Q,branch:BID,otherBranches:BID*):F[endless.transaction.Transaction[F,BID,Q,R]]" 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">create</span><span class="params">(<span name="id">id: <span name="endless.transaction.Coordinator.TID" class="extype">TID</span></span>, <span name="query">query: <span name="endless.transaction.Coordinator.Q" class="extype">Q</span></span>, <span name="branch">branch: <span name="endless.transaction.Coordinator.BID" class="extype">BID</span></span>, <span name="otherBranches">otherBranches: <span name="endless.transaction.Coordinator.BID" class="extype">BID</span>*</span>)</span><span class="result">: <span name="endless.transaction.Coordinator.F" class="extype">F</span>[<a href="Transaction.html" name="endless.transaction.Transaction" id="endless.transaction.Transaction" class="extype">Transaction</a>[<span name="endless.transaction.Coordinator.F" class="extype">F</span>, <span name="endless.transaction.Coordinator.BID" class="extype">BID</span>, <span name="endless.transaction.Coordinator.Q" class="extype">Q</span>, <span name="endless.transaction.Coordinator.R" class="extype">R</span>]]</span></span><p class="shortcomment cmt">Creates a new transaction with the given id, query and branches.</p><div class="fullcomment"><div class="comment cmt"><p>Creates a new transaction with the given id, query and branches.
</p></div><dl class="paramcmts block"><dt class="param">id</dt><dd class="cmt"><p>
the transaction id</p></dd><dt class="param">query</dt><dd class="cmt"><p>
the query to be executed (transaction payload)</p></dd><dt class="param">branch</dt><dd class="cmt"><p>
the first branch</p></dd><dt class="param">otherBranches</dt><dd class="cmt"><p>
the remaining branches</p></dd><dt>returns</dt><dd class="cmt"><p>
handle to the transaction</p></dd></dl><dl class="attributes block"><dt>Note</dt><dd><span class="cmt"><p>
the transaction identifier must be unique and an exception will be raised in the target
effect if a transaction with the same id already exists.</p></span></dd></dl></div></li><li class="indented0 " name="endless.transaction.Coordinator#get" group="Ungrouped" fullComment="yes" data-isabs="true" visbl="pub"><a id="get(id:TID):cats.effect.kernel.Resource[F,endless.transaction.Transaction[F,BID,Q,R]]" class="anchorToMember"></a><a id="get(TID):Resource[F,Transaction[F,BID,Q,R]]" class="anchorToMember"></a> <span class="permalink"><a href="../../endless/transaction/Coordinator.html#get(id:TID):cats.effect.kernel.Resource[F,endless.transaction.Transaction[F,BID,Q,R]]" 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">get</span><span class="params">(<span name="id">id: <span name="endless.transaction.Coordinator.TID" class="extype">TID</span></span>)</span><span class="result">: <span name="cats.effect.kernel.Resource" class="extype">Resource</span>[<span name="endless.transaction.Coordinator.F" class="extype">F</span>, <a href="Transaction.html" name="endless.transaction.Transaction" id="endless.transaction.Transaction" class="extype">Transaction</a>[<span name="endless.transaction.Coordinator.F" class="extype">F</span>, <span name="endless.transaction.Coordinator.BID" class="extype">BID</span>, <span name="endless.transaction.Coordinator.Q" class="extype">Q</span>, <span name="endless.transaction.Coordinator.R" class="extype">R</span>]]</span></span><p class="shortcomment cmt">Recovers a transaction with the given id.</p><div class="fullcomment"><div class="comment cmt"><p>Recovers a transaction with the given id. Can be used by recovering clients who lost the
effect if a transaction with the same id already exists.</p></span></dd></dl></div></li><li class="indented0 " name="endless.transaction.Coordinator#get" group="Ungrouped" fullComment="yes" data-isabs="true" visbl="pub"><a id="get(id:TID):endless.transaction.Transaction[F,BID,Q,R]" class="anchorToMember"></a><a id="get(TID):Transaction[F,BID,Q,R]" class="anchorToMember"></a> <span class="permalink"><a href="../../endless/transaction/Coordinator.html#get(id:TID):endless.transaction.Transaction[F,BID,Q,R]" 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">get</span><span class="params">(<span name="id">id: <span name="endless.transaction.Coordinator.TID" class="extype">TID</span></span>)</span><span class="result">: <a href="Transaction.html" name="endless.transaction.Transaction" id="endless.transaction.Transaction" class="extype">Transaction</a>[<span name="endless.transaction.Coordinator.F" class="extype">F</span>, <span name="endless.transaction.Coordinator.BID" class="extype">BID</span>, <span name="endless.transaction.Coordinator.Q" class="extype">Q</span>, <span name="endless.transaction.Coordinator.R" class="extype">R</span>]</span></span><p class="shortcomment cmt">Recovers a transaction with the given id.</p><div class="fullcomment"><div class="comment cmt"><p>Recovers a transaction with the given id. Can be used by recovering clients who lost the
handle to the transaction and that require further interaction with it, or to retrieve
information about past transactions.</p><p>Resource release leads to transaction abort if it is still pending (or a no-op if the
transaction is already completed).
information about past transactions.
</p></div><dl class="paramcmts block"><dt class="param">id</dt><dd class="cmt"><p>
the transaction id</p></dd><dt>returns</dt><dd class="cmt"><p>
handle to the transaction</p></dd></dl><dl class="attributes block"><dt>Note</dt><dd><span class="cmt"><p>
Expand Down
2 changes: 1 addition & 1 deletion api/lib/endless/transaction/Transaction$$AbortError.html

Large diffs are not rendered by default.

Loading

0 comments on commit 1afad4c

Please sign in to comment.