BuiltIn (health/ProbingPolicy.java)

lettuce · src/main/java/io/lettuce/core/failover/health/ProbingPolicy.java · java · MIT
database

Defines strategies for evaluating health probe results to determine whether to continue, succeed, or fail based on success and failure counts.

// Source: https://github.com/redis/lettuce | License: MIT | Copyright 2023-Present, Redis Ltd
// Provided via justclaw.it.com; keep this notice with the code.
package io.lettuce.core.failover.health;

/**
 * Interface for probing policies.
 *
 * <p>
 * A probing policy determines when to stop probing based on the results of previous probes.
 * </p>
 * <p>
 * The policy is evaluated after each probe, and the decision to continue, succeed, or fail is based on the number of remaining
 * probes, successes, and failures.
 * </p>
 *
 * @author Ali Takavci
 * @author Ivo Gaydazhiev
 * @since 7.4
 */
public interface ProbingPolicy {

    enum Decision {
        CONTINUE, SUCCESS, FAIL
    }

    Decision evaluate(ProbeContext data);

    interface ProbeContext {

        int getRemainingProbes();

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key