SubgraphEvent
data class SubgraphEvent<out State>(val step: Int, val node: String, val event: GraphEvent<*>, val state: State) : GraphEvent<State>
event happened inside the subgraph that node runs in step. A subgraph sends every event that a stream of its own would have, from the NodeStarted of its first node to its Completed or Interrupted, and they arrive after the NodeStarted of node and before its NodeCompleted. The steps inside event are those of the subgraph, which start at 1 on every visit.
graph.stream(case, config).collect { event ->
if (event is GraphEvent.SubgraphEvent) {
val inside = event.event
if (inside is GraphEvent.NodeStarted) println("${event.node} > ${inside.node} started")
}
}Content copied to clipboard
When the subgraph has a subgraph of its own, event is a SubgraphEvent again. innermost and path read through the layers.
Properties
Link copied to clipboard
what happened in the subgraph. Its state is the state of the subgraph.
Link copied to clipboard
The event that is not a SubgraphEvent: event, or the one inside it when subgraphs are nested.