Class: Faulty::Cache::CircuitProxy
- Inherits:
-
Object
- Object
- Faulty::Cache::CircuitProxy
- Defined in:
- lib/faulty/cache/circuit_proxy.rb
Overview
A circuit wrapper for cache backends
This class uses an internal Faulty::Circuit to prevent the cache backend from causing application issues. If the backend fails continuously, this circuit will trip to prevent cascading failures. This internal circuit uses an independent in-memory backend by default.
Defined Under Namespace
Classes: Options
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #fault_tolerant? ⇒ Boolean
-
#initialize(cache, **options) {|Options| ... } ⇒ CircuitProxy
constructor
A new instance of CircuitProxy.
Constructor Details
#initialize(cache, **options) {|Options| ... } ⇒ CircuitProxy
Returns a new instance of CircuitProxy.
43 44 45 46 |
# File 'lib/faulty/cache/circuit_proxy.rb', line 43 def initialize(cache, **, &block) @cache = cache @options = Options.new(, &block) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/faulty/cache/circuit_proxy.rb', line 12 def @options end |
Instance Method Details
#fault_tolerant? ⇒ Boolean
54 55 56 |
# File 'lib/faulty/cache/circuit_proxy.rb', line 54 def fault_tolerant? @cache.fault_tolerant? end |