Package groovy.concurrent
package groovy.concurrent
Structured concurrency abstractions for asynchronous and parallel programming.
Language-facing async types:
Awaitable— async computation handle and static combinator surface used with theawaitkeywordAwaitResult— success/failure value fromAwaitable.allSettled(Object...)AsyncScope— structured concurrencyAsyncChannel— CSP-style async channelAwaitableAdapter/AwaitableAdapterRegistry— SPI for third-party async types (RxJava, Reactor, …)
Actor
(message-passing), Pool (thread management),
and ParallelScope (combined async+parallel).
Supports virtual threads (JDK 21+) and fail-fast exception handling.
Runtime implementation details live in org.apache.groovy.runtime.async.
-
ClassDescriptionActor<T>A lightweight message-passing actor for concurrent state management.ActorContext<T>Context handle passed to context-aware actor handlers.Construction-time configuration for an
Actor.Policy applied whenActor.send(Object)is called on an actor whose bounded mailbox is full.Policy applied whenActorContext.stash()is called and the actor's bounded stash is already at capacity.Agent<T>A thread-safe mutable-value container inspired by Clojure's agents and GPars'Agent.AsyncChannel<T>An asynchronous channel for inter-task communication with optional buffering.A structured concurrency scope that ensures all child tasks complete (or are cancelled) before the scope exits.Awaitable<T>Core abstraction for asynchronous computations in Groovy.Service Provider Interface (SPI) for adapting third-party asynchronous types to Groovy'sAwaitableabstraction and to iterables forfor awaitloops.Central registry forAwaitableAdapterinstances.AwaitResult<T>Represents the outcome of an asynchronous computation that may have succeeded or failed.A one-to-many broadcast channel where each value sent is delivered to all subscribers.A handle for a scheduled action that can be called off before it fires (or that can have its further firings suppressed, in the case of a recurring schedule).Thrown when anAsyncChanneloperation is attempted after the channel has been closed.Selects the first offer that can complete among multipleAsyncChanneloperations.One branch of a select: an input guard created byChannelSelect.receive(AsyncChannel), an output guard created byChannelSelect.send(AsyncChannel, Object), or a timeout created byChannelSelect.after(long).The result of aChannelSelect.select()operation, indicating which offer committed.Central configuration for Groovy's concurrent and parallel features.A single-assignment variable for dataflow-style programming.Convenience API for running work within a pool-isolatedAsyncScope.A managed thread pool for parallel and concurrent operations.ReactorHandler<T,R> Context-aware handler for reactor actors.StatefulHandler<S,T> Context-aware handler for stateful actors.