ExecutorAsyncer

class ExecutorAsyncer(executor: Executor) : Asyncer

Asyncer implementation that uses an Executor for async operations, propagating to worker threads the AgentProcess (a domain concern, via AgentProcessAccessor), the com.embabel.common.ai.model.ModelSelectionContext (so a user's own provider key still decides model selection off the request thread), and the current Micrometer Observation (via the official ContextSnapshotFactory, so spans nest across threads; a no-op when no observation is current, e.g. a NOOP registry).

The model selection context matters here because the platform itself moves work off the calling thread - AgentPlatform.start, parallel actions, OperationContext.parallelMap. Losing it does not fail: role resolution quietly falls back to deployment configuration and serves a model the deployment pays for, on a call the user brought their own key for.

Constructors

Link copied to clipboard
constructor(executor: Executor)

Functions

Link copied to clipboard
open override fun <T> async(block: () -> T): CompletableFuture<T>
Link copied to clipboard
open override fun <T, R> parallelMap(items: Collection<T>, maxConcurrency: Int, transform: (t: T) -> R): List<R>