Package com.google.adk.workflow
Class NodeRunner
java.lang.Object
com.google.adk.workflow.NodeRunner
The runner for one workflow node, which times out an attempt that exceeds the node's optional
timeout and retries the node as its retry policy allows. It stamps every emitted event with its
author, node path, and branch before forwarding it, and records the node's output, routes,
interrupts, and failure on the node state of the returned context.
runRoot(com.google.adk.workflow.Node, com.google.adk.agents.InvocationContext, java.util.function.Function<? super com.google.adk.events.Event, ? extends io.reactivex.rxjava3.core.Single<com.google.adk.events.Event>>) runs a node
as the root of an invocation, and runChild(com.google.adk.agents.Context, com.google.adk.workflow.Node, java.lang.Object, com.google.adk.workflow.RunNodeConfig) runs one as a child that another node starts
itself.-
Method Summary
Modifier and TypeMethodDescriptionstatic io.reactivex.rxjava3.core.Maybe<Object>runChild(Context parent, Node node, @Nullable Object nodeInput, RunNodeConfig config) Runsnodeas a child of the node whose context isparent, asContext.runNode(Node, Object, RunNodeConfig)describes.static io.reactivex.rxjava3.core.Flowable<Event>runRoot(Node node, InvocationContext context, Function<? super Event, ? extends io.reactivex.rxjava3.core.Single<Event>> processEvent) Runsnodeas the root ofcontexton the invocation's user content, passing each event throughprocessEventin order; onlyRunnershould call this method.
-
Method Details
-
runRoot
@Experimental public static io.reactivex.rxjava3.core.Flowable<Event> runRoot(Node node, InvocationContext context, Function<? super Event, ? extends io.reactivex.rxjava3.core.Single<Event>> processEvent) Runsnodeas the root ofcontexton the invocation's user content, passing each event throughprocessEventin order; onlyRunnershould call this method. The node is asked for its next event, and its failure is signaled, only after the previous non-partial event is processed and emitted, so a failure follows the error event that reports it. If processing an event fails with an exception, the failures reported by unprocessed error events are attached to it as suppressed. -
runChild
@Experimental public static io.reactivex.rxjava3.core.Maybe<Object> runChild(Context parent, Node node, @Nullable Object nodeInput, RunNodeConfig config) Runsnodeas a child of the node whose context isparent, asContext.runNode(Node, Object, RunNodeConfig)describes. Nodes call that method; this one is public only soContextcan call it from another package.
-