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 Interruptible

#wake_up

Methods included from Procline

#procline

Constructor Details

#initializeBase

Returns a new instance of Base.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#hostnameObject



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

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

#kindObject



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

def kind
  self.class.name.demodulize
end

#metadataObject



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

def 
  {}
end

#pidObject



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

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

#stopObject



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

def stop
  @stopped = true
end