Package me.aartikov.replica.single.behaviour.standard

Types

Link copied to clipboard
class DoOnCreated<T : Any>(action: suspend PhysicalReplica<T>.() -> Unit) : ReplicaBehaviour<T>

ReplicaBehaviour that executes some action when a replica is created.

Link copied to clipboard
class DoOnEvent<T : Any>(action: suspend PhysicalReplica<T>.(event: ReplicaEvent<T>) -> Unit) : ReplicaBehaviour<T>

ReplicaBehaviour that executes some action on all ReplicaEvent.

Link copied to clipboard
class DoOnNetworkConnectivityChanged<T : Any>(networkConnectivityProvider: NetworkConnectivityProvider, action: suspend PhysicalReplica<T>.(connected: Boolean) -> Unit) : ReplicaBehaviour<T>

ReplicaBehaviour that executes some action when network connectivity status changed.

Link copied to clipboard
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.