RoutingSpec

@Serializable
sealed class RoutingSpec(source)

How a node routes processed instances. A closed set of variants.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
@Serializable
@SerialName(value = "byChance")
data class ByChance(val branches: List<ChanceBranch>) : RoutingSpec

Route probabilistically; branches probabilities must sum to 1.

Link copied to clipboard
@Serializable
@SerialName(value = "byCondition")
data class ByCondition(val cases: List<ConditionCase>, val default: String) : RoutingSpec

Route by predicate, first matching case wins, falling back to default. Each case names a predicate resolved at build time from the builder's predicate registry (behavior is not serialized — only the hook name). An unknown name fails the build loudly.

Link copied to clipboard
@Serializable
@SerialName(value = "byType")
data class ByType(val branches: List<TypeBranch>, val default: String) : RoutingSpec

Route by the instance's type id, falling back to default.

Link copied to clipboard
@Serializable
@SerialName(value = "direct")
data class Direct(val to: String) : RoutingSpec

Route directly to the node named to.

Link copied to clipboard
@Serializable
@SerialName(value = "shortestQueue")
data class ShortestQueue(val among: List<String>) : RoutingSpec

Route to whichever of among currently has the least work in process.