Class: StatsRole

Inherits:
Role
  • Object
show all
Defined in:
lib/stats_role.rb

Defined Under Namespace

Classes: StatsApp

Constant Summary collapse

PORT =
9500

Constants inherited from Role

Role::INDEX

Instance Method Summary collapse

Methods inherited from Role

#disable_link, #enable_link, get_role, #init_links, role, #state

Constructor Details

#initialize(manifest) ⇒ StatsRole

Returns a new instance of StatsRole.



9
10
11
12
13
# File 'lib/stats_role.rb', line 9

def initialize(manifest)
  super
  init_links 'db_read', @manifest['db_read']
  init_links 'db_peer', @manifest['db_peer']
end

Instance Method Details

#startObject Also known as: enable



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

def start
  start_server
end

#stopObject Also known as: disable



19
20
21
# File 'lib/stats_role.rb', line 19

def stop
  @http_server.shutdown
end