pub trait Config {
    type Node: Node;
    type Applicable: ApplicableTo<StateOf<Self::Node>> + 'static;
    type RetryPolicy: RetryPolicy<Invocation = InvocationOf<Self::Node>, Error = AppendError<InvocationOf<Self::Node>>, StaticError = AppendError<InvocationOf<Self::Node>>>;

    fn interval(&self) -> Option<Duration>;
    fn new_heartbeat(&self) -> Self::Applicable;
    fn retry_policy(&self) -> Self::RetryPolicy;

    fn init(&mut self, node: &Self::Node) { ... }
    fn update(&mut self, event: &EventFor<Self::Node>) { ... }
    fn leader_interval(&self) -> Option<Duration> { ... }
}
Expand description

Heartbeats configuration.

Required Associated Types

The node type that is decorated.

The applicable that is used to fill gaps, usually a no-op.

Type of retry policy to be used.

See retry_policy.

Required Methods

Interval at which heartbeats are sent.

Creates a new heartbeat value.

Creates a retry policy.

Please note that a node that’s fallen too far behind may fail to catch up using the heartbeat approach. This is because other nodes may respond with Conflict::Converged without providing a log entry. In these cases, the node must ask another node for a recent snapshot and install it. To detect such cases, one may use a retry policy that checks for AppendError::Converged and whether the node could be caught_up.

Provided Methods

Initializes this configuration.

Updates the configuration with the given event.

Interval at which leader nodes send heartbeats.

Implementors