ScopedCounter

constructor(maxDepth: Int, onOverflow: () -> Nothing)

Parameters

maxDepth

maximum allowed depth. If exceeded, onOverflow is invoked

onOverflow

action to perform when the maximum depth is exceeded