Class Runner.Builder
- Enclosing class:
Runner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionartifactService(BaseArtifactService artifactService) build()instantSource(@Nullable InstantSource instantSource) Sets theInstantSourcethat supplies every timestamp this runner generates: event timestamps, and thelastUpdateTimeof sessions created by the default in-memory session service, which is created on the firstbuild().memoryService(BaseMemoryService memoryService) scheduler(@Nullable io.reactivex.rxjava3.core.Scheduler scheduler) Sets theSchedulerfor the work ADK hands off to worker threads in this runner's invocations: the sub-agents of aParallelAgent, tool calls inRunConfig.ToolExecutionMode.PARALLEL_SUBSCRIBEmode, the nodes of a workflow graph and the items of aparallelNode, workflow node retries and attempts with a timeout, the hop that starts the live send loop, and the work that resumes after a wait for this runner to save events.sessionService(BaseSessionService sessionService) uuidProvider(@Nullable UuidProvider uuidProvider) Sets theUuidProviderthat supplies every identifier this runner generates: event, invocation, and client function-call ids, and the ids of sessions created by the default in-memory session service, which is created on the firstbuild().
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
app
-
agent
-
appName
-
artifactService
-
sessionService
-
memoryService
-
plugins
-
plugins
-
scheduler
@CanIgnoreReturnValue public Runner.Builder scheduler(@Nullable io.reactivex.rxjava3.core.Scheduler scheduler) Sets theSchedulerfor the work ADK hands off to worker threads in this runner's invocations: the sub-agents of aParallelAgent, tool calls inRunConfig.ToolExecutionMode.PARALLEL_SUBSCRIBEmode, the nodes of a workflow graph and the items of aparallelNode, workflow node retries and attempts with a timeout, the hop that starts the live send loop, and the work that resumes after a wait for this runner to save events. A workflowFunctionNodedecodes its input and runs its confirmation predicate and body on it, unlessFunctionNode.Builder#schedulersets another; then only the hand-back after them runs on it. The runs that anAgentToolnests inherit it. An agent-levelParallelAgent.Builder#schedulerorLlmAgent.Builder#executortakes precedence.null(the default) selectsSchedulers.io().Only these hand-offs are affected; work that completes asynchronously elsewhere (model clients, session services, MCP, plugins) stays on its own threads.
Schedulers.trampoline()runs these hand-offs inline, so sub-agents, tools, and graph nodes are subscribed sequentially, though anything they start asynchronously can still overlap; similarly, a bounded scheduler limits how many thread-blocking graph nodes run at once, and deadlocks once every thread holds a node blocked onrunNode(...).blockingGet()for a child, such as a nested workflow or aFunctionNode, that also needs a thread.When a workflow node's attempt has to wait for work it started, such as a child its body left running or a body that ignores its interrupt, the rest of the attempt, including its final or error event and the session append and plugin callbacks for it, continues on a
Schedulers.io()thread whatever this scheduler is. -
instantSource
Sets theInstantSourcethat supplies every timestamp this runner generates: event timestamps, and thelastUpdateTimeof sessions created by the default in-memory session service, which is created on the firstbuild().null(the default) selectsInstantSource.system(). -
uuidProvider
Sets theUuidProviderthat supplies every identifier this runner generates: event, invocation, and client function-call ids, and the ids of sessions created by the default in-memory session service, which is created on the firstbuild().null(the default) selectsUuidProvider.SYSTEM. -
build
-