Method: Servicy::Server#initialize

Defined in:
lib/server/server.rb

#initialize(transport = nil, load_balancer = nil, logger_stream = nil, config_file = nil) ⇒ Server

Create a new server that is used to register and find Services. TODO: I should really make this take an options hash, but that will require changing a lot of shit…

Parameters:

  • transport ({Servicy::Transport}) (defaults to: nil)

    The transport used to send and receive messages.



11
12
13
14
15
16
17
18
# File 'lib/server/server.rb', line 11

def initialize(transport=nil, load_balancer=nil, logger_stream=nil, config_file=nil)
  @transport            = transport || Servicy.config.server.transport
  @services             = [] # All services
  @deactivated_services = [] # Dead services
  @load_balancer        = load_balancer || Servicy.config.server.load_balancer
  @config_file          = config_file   || Servicy.config.server.config_file
  start_heartbeat_process
end