Class: Faulty::Storage::Null
- Inherits:
-
Object
- Object
- Faulty::Storage::Null
- Defined in:
- lib/faulty/storage/null.rb
Overview
A no-op backend for disabling circuits
Class Method Summary collapse
Instance Method Summary collapse
- #clear ⇒ void
-
#close(_circuit) ⇒ Boolean
True if the circuit transitioned from open to closed.
-
#entry(circuit, _time, _success, status) ⇒ Status?
If
status
is not nil, the updated status object. -
#fault_tolerant? ⇒ Boolean
This backend is fault tolerant.
-
#get_options(_circuit) ⇒ Hash
A hash of the options stored by #set_options.
-
#history(_circuit) ⇒ Array<Array>
An array of history tuples.
- #list ⇒ Array<String>
- #lock(_circuit, _state) ⇒ void
-
#open(_circuit, _opened_at) ⇒ Boolean
True if the circuit transitioned from closed to open.
-
#reopen(_circuit, _opened_at, _previous_opened_at) ⇒ Boolean
True if the opened_at time was updated.
- #reset(_circuit) ⇒ void
- #set_options(_circuit, _stored_options) ⇒ void
-
#status(circuit) ⇒ Status
The current status.
- #unlock(_circuit) ⇒ void
Class Method Details
.new ⇒ Object
10 11 12 |
# File 'lib/faulty/storage/null.rb', line 10 def self.new @instance end |
Instance Method Details
#clear ⇒ void
This method returns an undefined value.
84 85 |
# File 'lib/faulty/storage/null.rb', line 84 def clear end |
#close(_circuit) ⇒ Boolean
Returns True if the circuit transitioned from open to closed.
45 46 47 |
# File 'lib/faulty/storage/null.rb', line 45 def close(_circuit) true end |
#entry(circuit, _time, _success, status) ⇒ Status?
Returns If status
is not nil, the updated status object.
27 28 29 |
# File 'lib/faulty/storage/null.rb', line 27 def entry(circuit, _time, _success, status) stub_status(circuit) if status end |
#fault_tolerant? ⇒ Boolean
This backend is fault tolerant
91 92 93 |
# File 'lib/faulty/storage/null.rb', line 91 def fault_tolerant? true end |
#get_options(_circuit) ⇒ Hash
Returns A hash of the options stored by #set_options. The keys must be symbols.
16 17 18 |
# File 'lib/faulty/storage/null.rb', line 16 def (_circuit) {} end |
#history(_circuit) ⇒ Array<Array>
Returns An array of history tuples.
72 73 74 |
# File 'lib/faulty/storage/null.rb', line 72 def history(_circuit) [] end |
#list ⇒ Array<String>
78 79 80 |
# File 'lib/faulty/storage/null.rb', line 78 def list [] end |
#lock(_circuit, _state) ⇒ void
This method returns an undefined value.
51 52 |
# File 'lib/faulty/storage/null.rb', line 51 def lock(_circuit, _state) end |
#open(_circuit, _opened_at) ⇒ Boolean
Returns True if the circuit transitioned from closed to open.
33 34 35 |
# File 'lib/faulty/storage/null.rb', line 33 def open(_circuit, _opened_at) true end |
#reopen(_circuit, _opened_at, _previous_opened_at) ⇒ Boolean
Returns True if the opened_at time was updated.
39 40 41 |
# File 'lib/faulty/storage/null.rb', line 39 def reopen(_circuit, _opened_at, _previous_opened_at) true end |
#reset(_circuit) ⇒ void
This method returns an undefined value.
61 62 |
# File 'lib/faulty/storage/null.rb', line 61 def reset(_circuit) end |
#set_options(_circuit, _stored_options) ⇒ void
This method returns an undefined value.
22 23 |
# File 'lib/faulty/storage/null.rb', line 22 def (_circuit, ) end |
#status(circuit) ⇒ Status
Returns The current status.
66 67 68 |
# File 'lib/faulty/storage/null.rb', line 66 def status(circuit) stub_status(circuit) end |
#unlock(_circuit) ⇒ void
This method returns an undefined value.
56 57 |
# File 'lib/faulty/storage/null.rb', line 56 def unlock(_circuit) end |