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.



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

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#updated_atObject

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

Yields:

  • (_self)

Yield Parameters:



24
25
26
# File 'lib/semian/unprotected_resource.rb', line 24

def acquire(*)
  yield self
end

#bulkheadObject



61
62
63
# File 'lib/semian/unprotected_resource.rb', line 61

def bulkhead
  nil
end

#circuit_breakerObject



65
66
67
# File 'lib/semian/unprotected_resource.rb', line 65

def circuit_breaker
  nil
end

#closed?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/semian/unprotected_resource.rb', line 43

def closed?
  true
end

#countObject



28
29
30
# File 'lib/semian/unprotected_resource.rb', line 28

def count
  0
end

#destroyObject



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

def destroy
end

#half_open?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/semian/unprotected_resource.rb', line 47

def half_open?
  false
end

#in_use?Boolean

Returns:

  • (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_successObject



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

def mark_success
end

#open?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/semian/unprotected_resource.rb', line 39

def open?
  false
end

#registered_workersObject



13
14
15
# File 'lib/semian/unprotected_resource.rb', line 13

def registered_workers
  0
end

#request_allowed?Boolean

Returns:

  • (Boolean)


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

def request_allowed?
  true
end

#resetObject



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

def reset
end

#semidObject



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

def semid
  0
end

#ticketsObject



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

def tickets
  -1
end