Method: EasyType::Daemon#initialize

Defined in:
lib/easy_type/daemon.rb

#initialize(identifier, command, user) ⇒ Daemon

Initialize a command daemon. In the command daemon, the specified command is run in a daemon process. The specified command must readiths commands from stdi and output any results from stdout. A daemon proces must be identified by an identifier string. If you want to run multiple daemon processes, say for connecting to an other, you can use a different name.

If you want to run the daemon as an other user, you can specify a user name, the process will run under. This must be an existing user.

Checkout sync on how to sync the output. You can specify a timeout value to have the daemon read’s timed out if it dosen’t get an expected answer within that time.



38
39
40
41
42
43
44
45
46
# File 'lib/easy_type/daemon.rb', line 38

def initialize(identifier, command, user)
  if @@daemons[identifier]
    return @@daemons[identifier]
  else
    initialize_daemon(user, command)
    @identifier = identifier
    @@daemons[identifier] = self
  end
end