Class Skynet::Config
In: lib/skynet/skynet_config.rb
Parent: Object

Skynet has many global configuration options. You can access specific options via Skynet::CONFIG[:OPTION] = ? You can set many options via

   Skynet.configure(:OPTION => option, :ANOTHEROPTION => anotheroption)

If you want specific configuration to only apply to a block of code you can pass configure a block

   Skynet.configure(:SOMEOPTION => 'value') do
      run code here
   end

Config Options and current defaults:

 Skynet.configure(
  :ENABLE                               => true,
  :SOLO                                 => false,
  :SKYNET_PID_DIR                       => "/tmp",
  :SKYNET_PID_FILE                      => "skynet.pid",
  :SKYNET_LOG_DIR                       => ENV["HOME"],
  :SKYNET_LOG_FILE                      => "skynet.log",
  :SKYNET_LOG_LEVEL                     => Logger::ERROR,
  :SKYNET_LOCAL_MANAGER_URL             => "druby://localhost:40000",
  :MESSAGE_QUEUE_ADAPTER                => "Skynet::MessageQueueAdapter::TupleSpace",
  :TS_DRBURI                            => "druby://localhost:47647"
  :TS_USE_RINGSERVER                    => true,
  :TS_SERVER_HOSTS                      => ["localhost:7647"],
  :TS_SERVER_START_DELAY                => 10,
  :MYSQL_QUEUE_DATABASE                 => "skynet_queue",
  :MYSQL_TEMPERATURE_CHANGE_SLEEP       => 40,
  :MYSQL_QUEUE_TEMP_POW                 => 0.6,
  :MYSQL_MESSAGE_QUEUE_TAPLE            => "skynet_message_queues",
  :MYSQL_MESSAGE_QUEUE_TEMP_CHECK_DELAY => 40,
  :MYSQL_NEXT_TASK_TIMEOUT              => 60,
  :WORKER_CHECK_DELAY                   => 40,
  :GUID_GENERATOR                       => nil,
  :NUMBER_OF_WORKERS                    => 4,
  :PERCENTAGE_OF_TASK_ONLY_WORKERS      => 0.7,
  :PERCENTAGE_OF_MASTER_ONLY_WORKERS    => 0.2,
  :MAX_RETRIES                          => 6,
  :DEFAULT_MASTER_RETRY                 => 0,
  :DEFAULT_MAP_RETRY                    => 3,
  :DEFAULT_REDUCE_RETRY                 => 3
  :KEEP_MAP_TASKS                       => false,
  :KEEP_REDUCE_TASKS                    => false
 )

ENABLE turns Skynet on or off.

SOLO turns on SOLO mode where Skynet can run in the current process without workers. Its almost a Skynet emulation mode

MESSAGE_QUEUE_ADAPTER Skynet comes with 2 message queue adaptors

  Skynet::MessageQueueAdapter::TupleSpace
  Skynet::MessageQueueAdapter::Mysql

The default is TupleSpace which is an in memory database. The mysql MQ takes running a migration that comes with skynet_install

The following only apply to the TupleSpace adapter

  :TS_DRBURI                            => "druby://localhost:47647"
  :TS_USE_RINGSERVER                    => true,
  :TS_SERVER_HOSTS                      => ["localhost:7647"],

The following only apply to the Mysql adapter

  :MYSQL_QUEUE_DATABASE                 => "skynet_queue",
  :MYSQL_TEMPERATURE_CHANGE_SLEEP       => 40,
  :MYSQL_QUEUE_TEMP_POW                 => 0.6,
  :MYSQL_MESSAGE_QUEUE_TAPLE            => "skynet_message_queues",
  :MYSQL_MESSAGE_QUEUE_TEMP_CHECK_DELAY => 40,
  :MYSQL_NEXT_TASK_TIMEOUT              => 60,

Methods

Included Modules

Enumerable

Public Class methods

Public Instance methods

[Validate]