Class: Semian::UnprotectedResource

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ UnprotectedResource

Returns a new instance of UnprotectedResource.



7
8
9
# File 'lib/semian/unprotected_resource.rb', line 7

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/semian/unprotected_resource.rb', line 5

def name
  @name
end

Instance Method Details

#acquire {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



22
23
24
# File 'lib/semian/unprotected_resource.rb', line 22

def acquire(*)
  yield self
end

#bulkheadObject



59
60
61
# File 'lib/semian/unprotected_resource.rb', line 59

def bulkhead
  nil
end

#circuit_breakerObject



63
64
65
# File 'lib/semian/unprotected_resource.rb', line 63

def circuit_breaker
  nil
end

#closed?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/semian/unprotected_resource.rb', line 41

def closed?
  true
end

#countObject



26
27
28
# File 'lib/semian/unprotected_resource.rb', line 26

def count
  0
end

#destroyObject



19
20
# File 'lib/semian/unprotected_resource.rb', line 19

def destroy
end

#half_open?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/semian/unprotected_resource.rb', line 45

def half_open?
  false
end

#mark_failed(_error) ⇒ Object



53
54
# File 'lib/semian/unprotected_resource.rb', line 53

def mark_failed(_error)
end

#mark_successObject



56
57
# File 'lib/semian/unprotected_resource.rb', line 56

def mark_success
end

#open?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/semian/unprotected_resource.rb', line 37

def open?
  false
end

#registered_workersObject



11
12
13
# File 'lib/semian/unprotected_resource.rb', line 11

def registered_workers
  0
end

#request_allowed?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/semian/unprotected_resource.rb', line 49

def request_allowed?
  true
end

#resetObject



34
35
# File 'lib/semian/unprotected_resource.rb', line 34

def reset
end

#semidObject



30
31
32
# File 'lib/semian/unprotected_resource.rb', line 30

def semid
  0
end

#ticketsObject



15
16
17
# File 'lib/semian/unprotected_resource.rb', line 15

def tickets
  -1
end