Class: Dizby::AbstractServer

Inherits:
Object
  • Object
show all
Extended by:
Configurable
Defined in:
lib/dizby/server/abstract.rb

Direct Known Subclasses

BasicServer, DeadProtocol::Server

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Configurable

config_accessor, config_reader, config_writer

Constructor Details

#initialize(config, &log_transform) ⇒ AbstractServer

Returns a new instance of AbstractServer.


11
12
13
14
# File 'lib/dizby/server/abstract.rb', line 11

def initialize(config, &log_transform)
  @config = config
  @log = Dizby.create_logger(config[:logging], &log_transform)
end

Instance Attribute Details

#log (readonly)

Returns the value of attribute log


16
17
18
# File 'lib/dizby/server/abstract.rb', line 16

def log
  @log
end

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'lib/dizby/server/abstract.rb', line 29

def alive?
  true
end

#connect_to(uri)


19
20
21
# File 'lib/dizby/server/abstract.rb', line 19

def connect_to(uri)
  ProtocolManager.open_client(self, uri)
end

#make_distributed(obj, error)


33
34
35
36
37
38
39
40
# File 'lib/dizby/server/abstract.rb', line 33

def make_distributed(obj, error)
  if error
    RemoteDistributedError.new(obj)
  else
    log.debug("making distributed: #{obj.inspect}")
    DistributedObject.new(obj, self)
  end
end

#shutdown


27
# File 'lib/dizby/server/abstract.rb', line 27

def shutdown; end

#spawn_on(command, uri)


23
24
25
# File 'lib/dizby/server/abstract.rb', line 23

def spawn_on(command, uri)
  ProtocolManager.spawn_server(self, command, uri)
end