Method: Spawnling.default_options

Defined in:
lib/spawnling.rb

.default_options(options = {}) ⇒ Object

Set the options to use every time spawn is called unless specified otherwise. For example, in your environment, do something like this:

Spawnling::default_options = {:nice => 5}

to default to using the :nice option with a value of 5 on every call. Valid options are:

:method => (:thread | :fork | :yield)
:nice   => nice value of the forked process
:kill   => whether or not the parent process will kill the
           spawned child process when the parent exits
:argv   => changes name of the spawned process as seen in ps
:detach => whether or not Process.detach is called for spawned child
           processes.  You must wait for children on your own if you
           set this to false


53
54
55
56
# File 'lib/spawnling.rb', line 53

def self.default_options(options = {})
  @@default_options.merge!(options)
  @@logger.info "spawn> default options = #{options.inspect}" if @@logger
end