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")
}
}

When the subgraph has a subgraph of its own, event is a SubgraphEvent again. innermost and path read through the layers.

Constructors

Link copied to clipboard
constructor(step: Int, node: String, event: GraphEvent<*>, state: State)

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.

Link copied to clipboard
Link copied to clipboard

The nodes that lead to innermost, from node inwards: one name for each subgraph.

Link copied to clipboard
open override val state: State

the state the node received, in the type of this graph.

Link copied to clipboard
val step: Int