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 223305e  2026/03/27 00:08:34: Generated dev website from 
groovy-website@74dc40e
223305e is described below

commit 223305edf456352e688af205f4d0300c222e12cd
Author: jenkins <[email protected]>
AuthorDate: Fri Mar 27 00:08:34 2026 +0000

    2026/03/27 00:08:34: Generated dev website from groovy-website@74dc40e
---
 blog/groovy-async-await.html | 17 +++++++++--------
 search/search-index.json     |  2 +-
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/blog/groovy-async-await.html b/blog/groovy-async-await.html
index 5a9d266..598b4e6 100644
--- a/blog/groovy-async-await.html
+++ b/blog/groovy-async-await.html
@@ -474,14 +474,7 @@ cancelled:</p>
 <div class="content">
 <pre class="prettyprint highlight"><code data-lang="groovy">async 
raidWithTimeLimit(List&lt;Hero&gt; party, List&lt;Room&gt; rooms) {
     try {
-        await Awaitable.orTimeoutMillis(30_000) {
-            AsyncScope.withScope { scope -&gt;
-                var missions = unique(party, rooms).collect { hero, room -&gt;
-                    scope.async { await hero.scout(room) }
-                }
-                missions.collect { await it }
-            }
-        }
+        await Awaitable.orTimeout(raidDungeon(party, rooms), 30, SECONDS)
     } catch (TimeoutException e) {
         party.each { it.retreat() }
         return []  // no loot this time
@@ -494,6 +487,14 @@ cancelled:</p>
 a <code>TimeoutException</code> is thrown — which you handle with an ordinary
 <code>catch</code>, just like any other error.</p>
 </div>
+<div class="paragraph">
+<p>In simple cases, you can also use <code>completeOnTimeout</code>:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">var loot = await 
Awaitable.completeOnTimeout(raidDungeon(heroes, rooms), [], 30, 
SECONDS)</code></pre>
+</div>
+</div>
 </div>
 <div class="sect2">
 <h3 id="_complementing_jdk_structured_concurrency">Complementing JDK 
structured concurrency</h3>
diff --git a/search/search-index.json b/search/search-index.json
index 8cfc043..17b2ed7 100644
--- a/search/search-index.json
+++ b/search/search-index.json
@@ -254,7 +254,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&trade; Learn Documentation Download Support 
Contribute Ecosystem Blog posts Socia [...]
+        "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&trade; Learn Documentation Download Support 
Contribute Ecosystem Blog posts Socia [...]
         "url": "blog/groovy-async-await.html",
         "site": "dev"
     },

Reply via email to