Introduce redis store for the circuit breaker
Follow-up from Introduce circuit breaker for OpenAI client (!117993 - merged)
Suggestion Given the amount of webserver instances of production how a memory store is useful here. Looking at https://github.com/yammer/circuitbox/blob/main/lib/circuitbox/memory_store.rb it seems we'd end-up having one store per puma master?
🤔 Is there a Redis store available we could use instead?🤓
After going over the docs, we could use
Monetagem instead: Circuitbox also supports Moneta. And moneta supports:redis. The question is, do we want another library to add?
We either add
monetaor make the redis store moneta compatible. Looking at https://github.com/yammer/circuitbox/blob/main/lib/circuitbox/memory_store.rb it only requires a few methods to be implemented. Since the circuit break is behind a feature flag we could add the redis store later.
Proposal
Create an in-house memory store that supports Redis Cluster.