Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
spion committed Jun 19, 2023
1 parent 4f0a476 commit 1e393a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions 21-context-managers-transactions.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<hr>
<p>title: Context managers and transactions
layout: nuggets.html.pug
category: Advanced examples
level: 2</p>
<h2 id="date-2007-01-05">date: 2007-01-05</h2>
<p>Context managers are a useful tool. They automatically dispose of resources
<html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, target-densityDpi=medium-dpi"/><meta content="True" name="HandheldFriendly"/><title>Context managers and transactions</title><link rel="shortcut icon" href="/ico/favicon.ico"/><link rel="stylesheet" href="/styles/style.css"/><link rel="stylesheet" href="/styles/nuggets.css"/><link rel="stylesheet" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css"/></head><body><div class="main"><a href="https://github.com/promise-nuggets/promise-nuggets.github.io"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"/></a><h1><a class="back" href="/"></a><span>Context managers and transactions</span></h1><div class="content"><p>Context managers are a useful tool. They automatically dispose of resources
when the operation within the context completes or an error happens in that
context.</p>
<p>Lets agree that all our disposable resources have a <code>.dispose()</code> method. How
Expand Down Expand Up @@ -114,3 +108,6 @@ <h2 id="notes">Notes</h2>
// all resources are disposed of
})</code></pre>
<p>The possibilities are... endless!</p>
</div></div><script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script><script>function $(q) { return [].slice.call(document.querySelectorAll(q)); }
$('code').forEach(function(el) { el.className += ' prettyprint'; });
prettyPrint();</script></body></html>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, target-densityDpi=medium-dpi"/><meta content="True" name="HandheldFriendly"/><title>Promise nuggets</title><link rel="shortcut icon" href="/ico/favicon.ico"/><link rel="stylesheet" href="/styles/style.css"/><link rel="stylesheet" href="/styles/nuggets.css"/><link rel="stylesheet" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css"/></head><body><div class="main"><a href="https://github.com/promise-nuggets/promise-nuggets.github.io"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"/></a><h1><span>Promise nuggets</span></h1><div class="content"><div><div class="category"><div class="name"><h2>Introduction</h2></div><ol class="items"><li class="post"><a href="01-the-simplest-example.html">The simplest example</a></li><li class="post"><a href="02-creating-new-functions.html.html">Creating new functions</a></li><li class="post"><a href="02-creating-new-functions.html">Creating new functions</a></li><li class="post"><a href="03-power-of-then-sync-processing.html">The power of then - sync processing</a></li><li class="post"><a href="04-power-of-then-async-operations.html">The power of then - async operations</a></li><li class="post"><a href="05-the-first-relief-when-sync-becomes-async.html">The first relief - when sync becomes async</a></li><li class="post"><a href="06-safety-of-then-exceptions.html">Safety of then - thrown errors</a></li><li class="post"><a href="07-wrapping-callback-functions.html">Wrapping callback functions</a></li></ol></div><div class="category"><div class="name"><h2>Multiple operations</h2></div><ol class="items"><li class="post"><a href="11-doing-things-in-parallel.html">Doing things in parallel (async.parallel)</a></li><li class="post"><a href="12-doing-things-in-series.html">Doing things in series (async.waterfall)</a></li><li class="post"><a href="13-complex-task-dependencies.html">Complex task dependencies</a></li><li class="post"><a href="14-map-in-parallel.html">Parallel map (async.map)</a></li><li class="post"><a href="15-map-in-series.html">Series map (async.mapSeries)</a></li><li class="post"><a href="16-map-limit.html">Concurrency level (async.mapLimit)</a></li></ol></div><div class="category"><div class="name"><h2>Using deferred</h2></div><ol class="items"><li class="post"><a href="31-promise-timeouts.html">Promise-based timeouts</a></li></ol></div></div></div></div><script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script><script>function $(q) { return [].slice.call(document.querySelectorAll(q)); }
<html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, target-densityDpi=medium-dpi"/><meta content="True" name="HandheldFriendly"/><title>Promise nuggets</title><link rel="shortcut icon" href="/ico/favicon.ico"/><link rel="stylesheet" href="/styles/style.css"/><link rel="stylesheet" href="/styles/nuggets.css"/><link rel="stylesheet" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css"/></head><body><div class="main"><a href="https://github.com/promise-nuggets/promise-nuggets.github.io"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"/></a><h1><span>Promise nuggets</span></h1><div class="content"><div><div class="category"><div class="name"><h2>Introduction</h2></div><ol class="items"><li class="post"><a href="01-the-simplest-example.html">The simplest example</a></li><li class="post"><a href="02-creating-new-functions.html.html">Creating new functions</a></li><li class="post"><a href="02-creating-new-functions.html">Creating new functions</a></li><li class="post"><a href="03-power-of-then-sync-processing.html">The power of then - sync processing</a></li><li class="post"><a href="04-power-of-then-async-operations.html">The power of then - async operations</a></li><li class="post"><a href="05-the-first-relief-when-sync-becomes-async.html">The first relief - when sync becomes async</a></li><li class="post"><a href="06-safety-of-then-exceptions.html">Safety of then - thrown errors</a></li><li class="post"><a href="07-wrapping-callback-functions.html">Wrapping callback functions</a></li></ol></div><div class="category"><div class="name"><h2>Multiple operations</h2></div><ol class="items"><li class="post"><a href="11-doing-things-in-parallel.html">Doing things in parallel (async.parallel)</a></li><li class="post"><a href="12-doing-things-in-series.html">Doing things in series (async.waterfall)</a></li><li class="post"><a href="13-complex-task-dependencies.html">Complex task dependencies</a></li><li class="post"><a href="14-map-in-parallel.html">Parallel map (async.map)</a></li><li class="post"><a href="15-map-in-series.html">Series map (async.mapSeries)</a></li><li class="post"><a href="16-map-limit.html">Concurrency level (async.mapLimit)</a></li></ol></div><div class="category"><div class="name"><h2>Advanced examples</h2></div><ol class="items"><li class="post"><a href="21-context-managers-transactions.html">Context managers and transactions</a></li></ol></div><div class="category"><div class="name"><h2>Using deferred</h2></div><ol class="items"><li class="post"><a href="31-promise-timeouts.html">Promise-based timeouts</a></li></ol></div></div></div></div><script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script><script>function $(q) { return [].slice.call(document.querySelectorAll(q)); }
$('code').forEach(function(el) { el.className += ' prettyprint'; });
prettyPrint();</script></body></html>

0 comments on commit 1e393a6

Please sign in to comment.