DoOnStateCondition

class DoOnStateCondition<T : Any>(    condition: (ReplicaState<T>) -> Boolean,     startDelay: Duration = Duration.ZERO,     repeatInterval: Duration? = null,     action: suspend PhysicalReplica<T>.() -> Unit) : ReplicaBehaviour<T>

ReplicaBehaviour that executes an action when a state satisfies a condition. startDelay allows to delay execution of an action. If a state stops satisfying the condition before startDelay expires the action will not be executed. repeatInterval allows to execute an action periodically until a state satisfying the condition. null means execute the action once.

Constructors

Link copied to clipboard
fun <T : Any> DoOnStateCondition(    condition: (ReplicaState<T>) -> Boolean,     startDelay: Duration = Duration.ZERO,     repeatInterval: Duration? = null,     action: suspend PhysicalReplica<T>.() -> Unit)

Functions

Link copied to clipboard
open override fun setup(replica: PhysicalReplica<T>)