Consecutive Failure Breaker
class ConsecutiveFailureBreaker constructor(val maxConsecutiveFailures: Int = DEFAULT_MAX_CONSECUTIVE_FAILURES)
Stops calling a service once maxConsecutiveFailures calls in a row have failed.
A re-embed makes one embedding call per proposition. When the embedding service is down, every call fails, and each one waits out its own timeout and retries before the next starts, so trying them all can take a very long time. With this, one bad proposition is still skipped and the run continues, but a run of failures means the service is down: the remaining propositions are not attempted, and the caller reports them as such.
Not thread-safe; use one per run.