Group
@Serializable
@SerialName(value = "group")
A group of children that share its slice between them.
Samples
val text = """
{"root": "pool", "children": [
{"type": "group", "name": "repos", "maxConcurrent": 8, "template": {"maxConcurrent": 2}}
]}
"""
val written = Json.decodeFromString<TopologyDocument>(text)
val repos = (Topology.from(written) as TopologyParse.Valid).topology.children.single() as Topology.Group
check(repos.maxConcurrent == 8L)
check(repos.template == Topology.ChildTemplate(Weight.ONE, maxConcurrent = 2L))Content copied to clipboard
Constructors
Link copied to clipboard
constructor(name: String, weight: String = "1", children: List<TopologyDocument.Node> = emptyList(), template: TopologyDocument.ChildTemplate? = null, maxConcurrent: Long? = null)
Properties
Link copied to clipboard
Link copied to clipboard
the group's ceiling, over all its children together; null for none.
Link copied to clipboard
what each child the consumer attaches while running gets, or null when the group has only the children written here. A group with a template may declare no children of its own. template: {} attaches children at weight 1 with no ceiling. Migrating from v0.7.4: runtimeChildren: "1" is now template: { weight: "1" }. A strict decode refuses the old key; a lenient one (ignoreUnknownKeys) drops it silently, and a group that also declares children then loses its attached children without a problem, so decode strictly.