# Package org.apache.groovy.runtime.async

package org.apache.groovy.runtime.async
Runtime support for Groovy's `async`/`await`/`defer` language features.

Layout:

- `AsyncSupport` — public entry point used by compiler-generated code and by `Awaitable`
- `AsyncExecutors` — executor/scheduler configuration
- `AwaitCombinators` — `all`/`any`/`first`/ `allSettled` joining algorithms
- `GroovyPromise` — default `Awaitable` implementation
- `GeneratorBridge` — producer/consumer bridge for `yield return`
- `DefaultAsyncScope`, `DefaultAsyncChannel` — structured concurrency and CSP channel implementations

- Related Packages
  Package
  Description
  org.apache.groovy.runtime
  org.apache.groovy.runtime.indy
  Scoped invokedynamic SwitchPoint utilities for the Groovy MOP (GROOVY-12191).
- Classes
  Class
  Description
  AsyncClosureUtils
  Closure-specific async utilities that have no pure-Java equivalent.
  AsyncSupport
  Internal runtime support for the `async`/`await`/`defer` language features.
  DefaultActor<T>
  Default implementation of `Actor`.
  DefaultAsyncChannel<T>
  Default lock-based implementation of `AsyncChannel`.
  DefaultAsyncScope
  Default implementation of `AsyncScope` providing structured concurrency with configurable failure policy.
  DefaultPool
  Default implementation of `Pool`.
  FlowPublisherAdapter
  Adapter for `Flow.Publisher`, the JDK's built-in Reactive Streams type.
  GeneratorBridge<T>
  A producer/consumer bridge for async generators (`yield return`).
  GroovyPromise<T>
  Default `Awaitable` implementation backed by a `CompletableFuture`.
  ScopedLocal<T>
  A thread-scoped value holder that abstracts over `ThreadLocal` (JDK < 25) and `java.lang.ScopedValue` (JDK 25+), presenting a unified API modelled after `ScopedValue`.
  ScopedLocal.Carrier
  An immutable set of scoped-local bindings that can be applied atomically for the duration of a `Runnable` or `Supplier`.
  SelectClaim
  The single-winner state of one selection: the arbiter through which a group of competing offers (the branches of a `ChannelSelect`, or a lone channel operation) commits exactly one outcome between them.