Class: Patriot::Worker::JobStoreServer

Inherits:
Base
  • Object
show all
Defined in:
lib/patriot/worker/job_store_server.rb

Overview

a worker as info server

Constant Summary

Constants included from Util::Config

Util::Config::ADMIN_USER_KEY, Util::Config::DEFAULT_CONFIG, Util::Config::DEFAULT_PLUGIN_DIR, Util::Config::INFO_SERVER_PORT_KEY, Util::Config::PASSWORD_KEY, Util::Config::PLUGIN_DIR_KEY, Util::Config::PLUGIN_INIT_SCRIPT, Util::Config::PLUGIN_KEY, Util::Config::PLUGIN_LIB_DIR, Util::Config::USERNAME_KEY, Util::Config::WORKER_HOST_KEY, Util::Config::WORKER_USER_KEY

Instance Attribute Summary

Attributes inherited from Base

#config, #cycle, #host, #job_store, #started_at, #status

Instance Method Summary collapse

Methods inherited from Base

#execute_job, #get_pid, #initialize, #request_shutdown, #start_worker

Methods included from JobStore::Factory

create_jobstore

Methods included from Util::Retry

execute_with_retry

Methods included from Util::Logger

#create_logger

Methods included from Util::Config

#load_config, #load_plugins

Constructor Details

This class inherits a constructor from Patriot::Worker::Base

Instance Method Details

#build_infoserverObject

See Also:

  • Base#build_infoserver


10
11
12
# File 'lib/patriot/worker/job_store_server.rb', line 10

def build_infoserver
  return Patriot::Worker::InfoServer.new(self,@config)
end

#init_workerObject

See Also:



15
16
# File 'lib/patriot/worker/job_store_server.rb', line 15

def init_worker
end

#run_workerObject

See Also:



19
20
21
22
23
# File 'lib/patriot/worker/job_store_server.rb', line 19

def run_worker
  while(@status != Patriot::Worker::Status::SHUTDOWN)
    sleep @cycle
  end
end

#stop_workerObject

See Also:



26
27
28
# File 'lib/patriot/worker/job_store_server.rb', line 26

def stop_worker
  @logger.info "terminated"
end