winter / io.jentz.winter / Graph / createSubgraph

createSubgraph

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

Initialize and return a subgraph by using the subcomponent with subcomponentQualifier and this graph as parent.

A graph initialized with this method doesn't get closed when its parent gets closed but becomes inconsistent.

Use it with caution in cases where you need to initialize a lot of short-lived subgraphs that are managed by you e.g. a per request subgraph on a HTTP server that gets created per request and closed at the end.

Parameters

subcomponentQualifier - The subcomponentQualifier of the subcomponent.

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