Class: SolidQueue::Processes::Base

Inherits:
Object
  • Object
show all
Includes:
AppExecutor, Callbacks, Interruptible, Procline, Registrable
Defined in:
lib/solid_queue/processes/base.rb

Direct Known Subclasses

Poller, Scheduler, Supervisor

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AppExecutor

#handle_thread_error, #wrap_in_app_executor

Methods included from Registrable

#process_id

Methods included from Procline

#procline

Methods included from Interruptible

#wake_up

Constructor Details

#initializeBase

Returns a new instance of Base.



12
13
14
15
# File 'lib/solid_queue/processes/base.rb', line 12

def initialize(*)
  @name = generate_name
  @stopped = false
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/solid_queue/processes/base.rb', line 10

def name
  @name
end

Instance Method Details

#hostnameObject



21
22
23
# File 'lib/solid_queue/processes/base.rb', line 21

def hostname
  @hostname ||= Socket.gethostname.force_encoding(Encoding::UTF_8)
end

#kindObject



17
18
19
# File 'lib/solid_queue/processes/base.rb', line 17

def kind
  self.class.name.demodulize
end

#metadataObject



29
30
31
# File 'lib/solid_queue/processes/base.rb', line 29

def 
  {}
end

#pidObject



25
26
27
# File 'lib/solid_queue/processes/base.rb', line 25

def pid
  @pid ||= ::Process.pid
end

#stopObject



33
34
35
# File 'lib/solid_queue/processes/base.rb', line 33

def stop
  @stopped = true
end