winter / io.jentz.winter / Graph / openSubgraph

openSubgraph

fun openSubgraph(subcomponentQualifier: Any, identifier: Any? = null, block: ComponentBuilderBlock? = null): Graph

Initialize and return a subgraph by using the subcomponent with subcomponentQualifier and this graph as parent and register it under the subcomponentQualifier or when given under identifier.

The resulting graph gets automatically closed when this graph gets closed. You can later retrieve the subgraph by calling an instance retrieve method e.g.:

parent.instance<Graph>(identifier)

Parameters

subcomponentQualifier - The qualifier of the subcomponent.

identifier - An optional identifier to register the subgraph with.

block - An optional builder block to derive the subcomponent with.