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.
8 9 10 11 |
# File 'lib/semian/unprotected_resource.rb', line 8 def initialize(name) @name = name @updated_at = Time.now end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/semian/unprotected_resource.rb', line 5 def name @name end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
6 7 8 |
# File 'lib/semian/unprotected_resource.rb', line 6 def updated_at @updated_at end |
Instance Method Details
#acquire {|_self| ... } ⇒ Object
24 25 26 |
# File 'lib/semian/unprotected_resource.rb', line 24 def acquire(*) yield self end |
#bulkhead ⇒ Object
61 62 63 |
# File 'lib/semian/unprotected_resource.rb', line 61 def bulkhead nil end |
#circuit_breaker ⇒ Object
65 66 67 |
# File 'lib/semian/unprotected_resource.rb', line 65 def circuit_breaker nil end |
#closed? ⇒ Boolean
43 44 45 |
# File 'lib/semian/unprotected_resource.rb', line 43 def closed? true end |
#count ⇒ Object
28 29 30 |
# File 'lib/semian/unprotected_resource.rb', line 28 def count 0 end |
#destroy ⇒ Object
21 22 |
# File 'lib/semian/unprotected_resource.rb', line 21 def destroy end |
#half_open? ⇒ Boolean
47 48 49 |
# File 'lib/semian/unprotected_resource.rb', line 47 def half_open? false end |
#in_use? ⇒ Boolean
69 70 71 |
# File 'lib/semian/unprotected_resource.rb', line 69 def in_use? true end |
#mark_failed(_error) ⇒ Object
55 56 |
# File 'lib/semian/unprotected_resource.rb', line 55 def mark_failed(_error) end |
#mark_success ⇒ Object
58 59 |
# File 'lib/semian/unprotected_resource.rb', line 58 def mark_success end |
#open? ⇒ Boolean
39 40 41 |
# File 'lib/semian/unprotected_resource.rb', line 39 def open? false end |
#registered_workers ⇒ Object
13 14 15 |
# File 'lib/semian/unprotected_resource.rb', line 13 def registered_workers 0 end |
#request_allowed? ⇒ Boolean
51 52 53 |
# File 'lib/semian/unprotected_resource.rb', line 51 def request_allowed? true end |
#reset ⇒ Object
36 37 |
# File 'lib/semian/unprotected_resource.rb', line 36 def reset end |
#semid ⇒ Object
32 33 34 |
# File 'lib/semian/unprotected_resource.rb', line 32 def semid 0 end |
#tickets ⇒ Object
17 18 19 |
# File 'lib/semian/unprotected_resource.rb', line 17 def tickets -1 end |