Class: SimpleWorker::LocalWorker

Inherits:
Object
  • Object
show all
Includes:
AbstractWorker
Defined in:
lib/simpleworker/local_worker.rb

Instance Attribute Summary

Attributes included from AbstractWorker

#cmd, #script

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AbstractWorker

#env, #start, #stop, #wait

Constructor Details

#initializeLocalWorker



6
7
8
9
# File 'lib/simpleworker/local_worker.rb', line 6

def initialize
  @script = %W[bash #{File.expand_path(File.dirname(__FILE__))}/bash/simple-localworker]
  @env = {}
end

Class Method Details

.create(config = {}) ⇒ Object



11
12
13
14
15
16
# File 'lib/simpleworker/local_worker.rb', line 11

def self.create(config = {})
  worker = new
  worker.script = config['script'] if config.has_key? 'script'
  worker.cmd = config['cmd'] if config.has_key? 'cmd'
  worker
end