Class: DRbQS::Execution::ExecuteNode
- Inherits:
-
Object
- Object
- DRbQS::Execution::ExecuteNode
- Defined in:
- lib/drbqs/execute/execute_node.rb
Instance Method Summary collapse
- #execute(process_num, interval = 0) ⇒ Object
-
#initialize(uri, log_prefix, log_level, node_opts = {}) ⇒ ExecuteNode
constructor
A new instance of ExecuteNode.
Constructor Details
#initialize(uri, log_prefix, log_level, node_opts = {}) ⇒ ExecuteNode
Returns a new instance of ExecuteNode.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/drbqs/execute/execute_node.rb', line 4 def initialize(uri, log_prefix, log_level, node_opts = {}) @uri = uri @log_level = log_level if log_prefix @fname = FileName.new(log_prefix, :position => :suffix, :type => :time, :add => :always, :directory => :parent, :format => lambda { |t| t.strftime("%Y%m%d_%H%M_#{Process.pid}.log") }) else @fname = nil end @node_opts = node_opts end |
Instance Method Details
#execute(process_num, interval = 0) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/drbqs/execute/execute_node.rb', line 25 def execute(process_num, interval = 0) opts = @node_opts.merge({ :log_level => @log_level, :log_file => get_log_file, :process => process_num }) node = DRbQS::Node.new(@uri, opts) node.connect node.calculate end |