Class: Faulty::Storage::CircuitProxy
- Inherits:
-
Object
- Object
- Faulty::Storage::CircuitProxy
- Defined in:
- lib/faulty/storage/circuit_proxy.rb
Overview
A circuit wrapper for storage backends
This class uses an internal Circuit to prevent the storage 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? ⇒ true
This cache makes any storage fault tolerant, so this is always
true
. -
#initialize(storage, **options) {|Options| ... } ⇒ CircuitProxy
constructor
A new instance of CircuitProxy.
Constructor Details
#initialize(storage, **options) {|Options| ... } ⇒ CircuitProxy
Returns a new instance of CircuitProxy.
43 44 45 46 |
# File 'lib/faulty/storage/circuit_proxy.rb', line 43 def initialize(storage, **, &block) @storage = storage @options = Options.new(, &block) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/faulty/storage/circuit_proxy.rb', line 12 def @options end |
Instance Method Details
#fault_tolerant? ⇒ true
This cache makes any storage fault tolerant, so this is always true
71 72 73 |
# File 'lib/faulty/storage/circuit_proxy.rb', line 71 def fault_tolerant? @storage.fault_tolerant? end |