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(Node, InvocationContext, Function) runs a node
as the root of an invocation, and runChild(Context, Node, Object, RunNodeConfig) runs one as a child that another node starts
itself.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisWaitSignal(Throwable error) Returns whethererrorsignals that a child node waits, which must end its caller's run so the caller waits too, rather than count as a failure.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.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
-
isWaitSignal
Returns whethererrorsignals that a child node waits, which must end its caller's run so the caller waits too, rather than count as a failure.This method is only for use by Agent Development Kit.
-
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.
-