Class: Pione::Command::PioneTaskWorker

Inherits:
BasicCommand show all
Defined in:
lib/pione/command/pione-task-worker.rb

Overview

PioneTaskWorker is a command that runs pione task worker agents.

Instance Attribute Summary collapse

Attributes inherited from Rootage::Command

#argument_definition, #argv, #option_definition

Attributes inherited from Rootage::Scenario

#args, #current_phase, #exit_status, #info, #model, #running_thread

Class Method Summary collapse

Methods inherited from BasicCommand

#abort, #program_name

Methods inherited from Rootage::StandardCommand

execution, setup, #terminate, termination

Methods inherited from Rootage::Command

#<<, define_subcommand, #exit, has_subcommands?, inherited, init, #initialize, #program_name, #run, #scenario_name, toplevel?

Methods inherited from Rootage::Scenario

#<<, #abort, define_action, #exit, inherited, #initialize, make, require, #run, run, scenario_name

Methods included from Rootage::ScenarioInterface

#define, #define_phase, #desc, #phase, #phase_class, #process_context_class, #scenario_name

Constructor Details

This class inherits a constructor from Rootage::Command

Instance Attribute Details

#agentObject (readonly)

instance methods



76
77
78
# File 'lib/pione/command/pione-task-worker.rb', line 76

def agent
  @agent
end

#tuple_space_serverObject (readonly)

Returns the value of attribute tuple_space_server.



77
78
79
# File 'lib/pione/command/pione-task-worker.rb', line 77

def tuple_space_server
  @tuple_space_server
end

Class Method Details

.spawn(model, param = {}) ⇒ Object

Create a new process of pione-task-worker command.

Parameters:

Options Hash (param):

  • :features (Array<String>)

    list of features that the task worker has

  • :tuple_space_id (String)

    ID of tuple space that the task worker works in



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/pione/command/pione-task-worker.rb', line 17

def self.spawn(model, param={})
  spawner = Spawner.new(model, "pione-task-worker")

  # debug options
  spawner.option_if(Global.debug_system, "--debug=system")
  spawner.option_if(Global.debug_ignored_exception, "--debug=ignored_exception")
  spawner.option_if(Global.debug_rule_engine, "--debug=rule_engine")
  spawner.option_if(Global.debug_communication, "--debug=communication")
  spawner.option_if(Global.debug_notification, "--debug=notification")

  # requisite options
  spawner.option_from(model, :front, "--parent-front", lambda {|val| val.uri})
  spawner.option_from(param, :tuple_space_id, "--tuple-space-id")
  spawner.option_from(param, :features, "--features")

  # others
  spawner.option("--color", Global.color_enabled)
  spawner.option("--file-cache-method", System::FileCache.cache_method.name)
  spawner.option("--file-sliding", Global.file_sliding)

  spawner.spawn # this method returns child front
end