This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-dev-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 5112c1b 2026/04/07 23:43:15: Generated dev website from
groovy-website@6d12000
5112c1b is described below
commit 5112c1bd5ab0f08060c6c859c6e4f0db65e22b90
Author: jenkins <[email protected]>
AuthorDate: Tue Apr 7 23:43:15 2026 +0000
2026/04/07 23:43:15: Generated dev website from groovy-website@6d12000
---
blog/groovy-async-await.html | 14 +++++++-------
search/search-index.json | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/blog/groovy-async-await.html b/blog/groovy-async-await.html
index 4ed4629..869cc43 100644
--- a/blog/groovy-async-await.html
+++ b/blog/groovy-async-await.html
@@ -576,11 +576,11 @@ is a race condition:</p>
</div>
<div class="listingblock">
<div class="content">
-<pre class="prettyprint highlight"><code data-lang="groovy">// UNSAFE
-var count = 0
-def tasks = (1..100).collect { async { count++ } }
+<pre class="prettyprint highlight"><code data-lang="groovy">// UNSAFE — shared
mutation is a race condition
+var total = 0
+def tasks = heroes.collect { h -> async { total += fetchScore(h) } }
tasks.each { await it }
-// count may not be 100!</code></pre>
+// total may be wrong!</code></pre>
</div>
</div>
<div class="paragraph">
@@ -588,10 +588,10 @@ tasks.each { await it }
</div>
<div class="listingblock">
<div class="content">
-<pre class="prettyprint highlight"><code data-lang="groovy">// SAFE
-def tasks = (1..100).collect { n -> async { n } }
+<pre class="prettyprint highlight"><code data-lang="groovy">// SAFE — each
task returns its result
+def tasks = heroes.collect { h -> async { fetchScore(h) } }
def results = await Awaitable.all(*tasks)
-assert results.sum() == 5050</code></pre>
+def total = results.sum()</code></pre>
</div>
</div>
<div class="paragraph">
diff --git a/search/search-index.json b/search/search-index.json
index 9e7e7b4..f9722e7 100644
--- a/search/search-index.json
+++ b/search/search-index.json
@@ -261,7 +261,7 @@
{
"id": "blog/groovy-async-await.html",
"title": "The Apache Groovy programming language - Blogs - Async/await
for Groovy™",
- "content": "The Apache Groovy programming language - Blogs -
Async/await for Groovy™ Socialize Discuss on the mailing list Groovy on X
Groovy on Bluesky Groovy on Mastodon Groovy on LinkedIn Events and conferences
Source code on GitHub Report issues in Jira Stack Overflow questions Slack
Community You are using an outdated browser. Please upgrade your browser to
improve your experience. Apache Groovy™ Learn Documentation Download
Support Contribute Ecosystem Blog post [...]
+ "content": "The Apache Groovy programming language - Blogs -
Async/await for Groovy™ Socialize Discuss on the mailing list Groovy on X
Groovy on Bluesky Groovy on Mastodon Groovy on LinkedIn Events and conferences
Source code on GitHub Report issues in Jira Stack Overflow questions Slack
Community You are using an outdated browser. Please upgrade your browser to
improve your experience. Apache Groovy™ Learn Documentation Download
Support Contribute Ecosystem Blog post [...]
"url": "blog/groovy-async-await.html",
"site": "dev"
},