Class: RSwim::Member::Peer::CustomStateHolder

Inherits:
Object
  • Object
show all
Defined in:
lib/rswim/member/peer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, node_member_id) ⇒ CustomStateHolder

Returns a new instance of CustomStateHolder.



105
106
107
108
109
110
# File 'lib/rswim/member/peer.rb', line 105

def initialize(id, node_member_id)
  @id = id
  @node_member_id = node_member_id
  @state = {}
  @propagation_count = 0
end

Instance Attribute Details

#propagation_countObject (readonly)

Returns the value of attribute propagation_count.



103
104
105
# File 'lib/rswim/member/peer.rb', line 103

def propagation_count
  @propagation_count
end

#stateObject

Returns the value of attribute state.



103
104
105
# File 'lib/rswim/member/peer.rb', line 103

def state
  @state
end

Instance Method Details

#increment_propagation_countObject



118
119
120
# File 'lib/rswim/member/peer.rb', line 118

def increment_propagation_count
  @propagation_count += 1
end

#loggerObject



122
123
124
# File 'lib/rswim/member/peer.rb', line 122

def logger
  @_logger ||= RSwim::Logger.new("Node #{@node_member_id}", $stderr)
end