The God::Server oversees the DRb server which dishes out info on this God daemon.
Forward API calls to God
Returns whatever the forwarded call returns
# File lib/god/socket.rb, line 57 def method_missing(*args, &block) God.send(*args, &block) end
Returns true
# File lib/god/socket.rb, line 50 def ping true end
The address of the socket for this Server
Returns String (drb address)
# File lib/god/socket.rb, line 35 def socket self.class.socket(@port) end
The location of the socket for this Server
Returns String (file location)
# File lib/god/socket.rb, line 28 def socket_file self.class.socket_file(@port) end
Stop the DRb server and delete the socket file
Returns nothing
# File lib/god/socket.rb, line 64 def stop DRb.stop_service FileUtils.rm_f(self.socket_file) end
Create a new Server and star the DRb server
+port+ is the port on which to start the DRb service (default nil)
# File lib/god/socket.rb, line 41 def initialize(port = nil, user = nil, group = nil, perm = nil) @port = port @user = user @group = group @perm = perm start end
The address of the socket for a given port
+port+ is the port number
Returns String (drb address)
# File lib/god/socket.rb, line 21 def self.socket(port) "drbunix://#{self.socket_file(port)}" end
The location of the socket for a given port
+port+ is the port number
Returns String (file location)
# File lib/god/socket.rb, line 13 def self.socket_file(port) "/tmp/god.#{port}.sock" end