Class: Semian::UnprotectedResource
- Inherits:
-
Object
- Object
- Semian::UnprotectedResource
- Defined in:
- lib/semian/unprotected_resource.rb
Overview
This class acts as a replacement for ‘ProtectedResource` when the semian configuration of an `Adapter` is missing or explicitly disabled
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #acquire {|_self| ... } ⇒ Object
- #bulkhead ⇒ Object
- #circuit_breaker ⇒ Object
- #closed? ⇒ Boolean
- #count ⇒ Object
- #destroy ⇒ Object
- #half_open? ⇒ Boolean
- #in_use? ⇒ Boolean
-
#initialize(name) ⇒ UnprotectedResource
constructor
A new instance of UnprotectedResource.
- #mark_failed(_error) ⇒ Object
- #mark_success ⇒ Object
- #open? ⇒ Boolean
- #registered_workers ⇒ Object
- #request_allowed? ⇒ Boolean
- #reset ⇒ Object
- #semid ⇒ Object
- #tickets ⇒ Object
Constructor Details
#initialize(name) ⇒ UnprotectedResource
Returns a new instance of UnprotectedResource.
10 11 12 13 |
# File 'lib/semian/unprotected_resource.rb', line 10 def initialize(name) @name = name @updated_at = Process.clock_gettime(Process::CLOCK_MONOTONIC) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/semian/unprotected_resource.rb', line 7 def name @name end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
8 9 10 |
# File 'lib/semian/unprotected_resource.rb', line 8 def updated_at @updated_at end |
Instance Method Details
#acquire {|_self| ... } ⇒ Object
26 27 28 |
# File 'lib/semian/unprotected_resource.rb', line 26 def acquire(*) yield self end |
#bulkhead ⇒ Object
63 64 65 |
# File 'lib/semian/unprotected_resource.rb', line 63 def bulkhead nil end |
#circuit_breaker ⇒ Object
67 68 69 |
# File 'lib/semian/unprotected_resource.rb', line 67 def circuit_breaker nil end |
#closed? ⇒ Boolean
45 46 47 |
# File 'lib/semian/unprotected_resource.rb', line 45 def closed? true end |
#count ⇒ Object
30 31 32 |
# File 'lib/semian/unprotected_resource.rb', line 30 def count 0 end |
#destroy ⇒ Object
23 24 |
# File 'lib/semian/unprotected_resource.rb', line 23 def destroy end |
#half_open? ⇒ Boolean
49 50 51 |
# File 'lib/semian/unprotected_resource.rb', line 49 def half_open? false end |
#in_use? ⇒ Boolean
71 72 73 |
# File 'lib/semian/unprotected_resource.rb', line 71 def in_use? true end |
#mark_failed(_error) ⇒ Object
57 58 |
# File 'lib/semian/unprotected_resource.rb', line 57 def mark_failed(_error) end |
#mark_success ⇒ Object
60 61 |
# File 'lib/semian/unprotected_resource.rb', line 60 def mark_success end |
#open? ⇒ Boolean
41 42 43 |
# File 'lib/semian/unprotected_resource.rb', line 41 def open? false end |
#registered_workers ⇒ Object
15 16 17 |
# File 'lib/semian/unprotected_resource.rb', line 15 def registered_workers 0 end |
#request_allowed? ⇒ Boolean
53 54 55 |
# File 'lib/semian/unprotected_resource.rb', line 53 def request_allowed? true end |
#reset ⇒ Object
38 39 |
# File 'lib/semian/unprotected_resource.rb', line 38 def reset end |
#semid ⇒ Object
34 35 36 |
# File 'lib/semian/unprotected_resource.rb', line 34 def semid 0 end |
#tickets ⇒ Object
19 20 21 |
# File 'lib/semian/unprotected_resource.rb', line 19 def tickets -1 end |