Liking cljdoc? Tell your friends :D

lb.cluster.sync

State synchronization providers for cluster mode.

This namespace provides IStateProvider implementations for:

  • Health status synchronization
  • Circuit breaker state synchronization
  • Drain coordination

Each provider implements the protocol from lb.cluster.protocol.

State synchronization providers for cluster mode.

This namespace provides IStateProvider implementations for:
- Health status synchronization
- Circuit breaker state synchronization
- Drain coordination

Each provider implements the protocol from lb.cluster.protocol.
raw docstring

broadcast-circuit-change!clj

(broadcast-circuit-change! target-id cb-state)

Broadcast a circuit breaker state change.

Broadcast a circuit breaker state change.
sourceraw docstring

broadcast-circuit-open!clj

(broadcast-circuit-open! target-id cb-state)

Immediately broadcast circuit breaker opening to prevent thundering herd.

Immediately broadcast circuit breaker opening to prevent thundering herd.
sourceraw docstring

broadcast-drain-complete!clj

(broadcast-drain-complete! target-id)

Broadcast drain completion to the cluster.

Broadcast drain completion to the cluster.
sourceraw docstring

broadcast-drain-start!clj

(broadcast-drain-start! target-id proxy-name)

Broadcast drain start to the cluster.

Broadcast drain start to the cluster.
sourceraw docstring

broadcast-health-change!clj

(broadcast-health-change! target-id health-state)

Broadcast a health status change to the cluster.

Broadcast a health status change to the cluster.
sourceraw docstring

create-circuit-breaker-providerclj

(create-circuit-breaker-provider get-cb-states-fn apply-cb-fn)

Create a circuit breaker state provider.

Args:

  • get-cb-states-fn: (fn [] {target-id -> {:state :closed/:open/:half-open :error-rate float :last-transition ms}})
  • apply-cb-fn: (fn [target-id remote-state] ...) to apply remote CB state

Returns an IStateProvider implementation.

Conflict Resolution:

  • OPEN always wins (conservative, prevents thundering herd)
  • HALF-OPEN beats CLOSED (testing phase should propagate)
  • CLOSED only applies if remote is definitely newer
Create a circuit breaker state provider.

Args:
- get-cb-states-fn: (fn [] {target-id -> {:state :closed/:open/:half-open
                                           :error-rate float
                                           :last-transition ms}})
- apply-cb-fn: (fn [target-id remote-state] ...) to apply remote CB state

Returns an IStateProvider implementation.

Conflict Resolution:
- OPEN always wins (conservative, prevents thundering herd)
- HALF-OPEN beats CLOSED (testing phase should propagate)
- CLOSED only applies if remote is definitely newer
sourceraw docstring

create-drain-providerclj

(create-drain-provider get-drain-states-fn apply-drain-fn)

Create a drain coordination state provider.

Args:

  • get-drain-states-fn: (fn [] {target-id -> {:status :draining/:drained/:active :start-time ms :proxy-name str}})
  • apply-drain-fn: (fn [target-id remote-state] ...) to apply remote drain

Returns an IStateProvider implementation.

Conflict Resolution:

  • :draining wins over :active (active drain takes precedence)
  • :drained only if all nodes agree
Create a drain coordination state provider.

Args:
- get-drain-states-fn: (fn [] {target-id -> {:status :draining/:drained/:active
                                              :start-time ms
                                              :proxy-name str}})
- apply-drain-fn: (fn [target-id remote-state] ...) to apply remote drain

Returns an IStateProvider implementation.

Conflict Resolution:
- :draining wins over :active (active drain takes precedence)
- :drained only if all nodes agree
sourceraw docstring

create-health-providerclj

(create-health-provider get-health-states-fn apply-health-fn)

Create a health state provider.

Args:

  • get-health-states-fn: (fn [] {target-id -> {:status :healthy/:unhealthy/:unknown :last-check-time ms :consecutive-successes n :consecutive-failures n}})
  • apply-health-fn: (fn [target-id remote-state] ...) to apply remote health

Returns an IStateProvider implementation.

Create a health state provider.

Args:
- get-health-states-fn: (fn [] {target-id -> {:status :healthy/:unhealthy/:unknown
                                               :last-check-time ms
                                               :consecutive-successes n
                                               :consecutive-failures n}})
- apply-health-fn: (fn [target-id remote-state] ...) to apply remote health

Returns an IStateProvider implementation.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close