Class: RestFtpDaemon::Worker

Inherits:
Object
  • Object
show all
Includes:
NewRelic::Agent::Instrumentation::ControllerInstrumentation, LoggerHelper
Defined in:
lib/rest-ftp-daemon/worker.rb

Direct Known Subclasses

ConchitaWorker, JobWorker

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wid) ⇒ Worker

Returns a new instance of Worker.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rest-ftp-daemon/worker.rb', line 10

def initialize wid
  # Logger
  @logger = RestFtpDaemon::LoggerPool.instance.get :workers
  @log_worker_status_changes = true

  # Worker name
  @wid = wid

  # Set thread context
  Thread.current.thread_variable_set :wid, wid
  Thread.current.thread_variable_set :started_at, Time.now
  worker_status WORKER_STATUS_STARTING
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



4
5
6
# File 'lib/rest-ftp-daemon/worker.rb', line 4

def logger
  @logger
end