Class: RailsRole
Defined Under Namespace
Classes: MyApp
Constant Summary collapse
- PORT =
9300
Constants inherited from Role
Instance Method Summary collapse
-
#initialize(manifest) ⇒ RailsRole
constructor
A new instance of RailsRole.
- #start ⇒ Object (also: #enable)
- #stop ⇒ Object (also: #disable)
Methods inherited from Role
#disable_link, #enable_link, get_role, #init_links, role, #state
Constructor Details
#initialize(manifest) ⇒ RailsRole
Returns a new instance of RailsRole.
9 10 11 12 13 14 |
# File 'lib/app_role.rb', line 9 def initialize(manifest) super init_links 'db_write', @manifest['db_write'] init_links 'db_read', @manifest['db_read'] init_links 'db_peer', @manifest['db_peer'] end |
Instance Method Details
#start ⇒ Object Also known as: enable
16 17 18 19 20 21 22 |
# File 'lib/app_role.rb', line 16 def start # @manifest['db'].each do |db_addr| # @db_sockets[db_addr] = DemoSocket.connect(db_addr, DbRole::PORT) #end start_server end |
#stop ⇒ Object Also known as: disable
24 25 26 27 |
# File 'lib/app_role.rb', line 24 def stop @http_server.shutdown # @db_sockets.each { |a,s| s.close } end |