class Sidekiq::Process
}
‘embedded’ => true,
‘identity’ => <unique string identifying the process>,
‘beat’ => <last heartbeat>,
‘busy’ => 10,
‘queues’ => [‘default’, ‘low’],
‘concurrency’ => 25,
‘tag’ => ‘myapp’
‘pid’ => 12345,
‘started_at’ => <process start time>,
‘hostname’ => ‘app-1.example.com’,
{
Each process has a set of attributes which look like this:
Sidekiq::Process represents an active Sidekiq process talking with Redis.
def [](key)
def [](key) @attribs[key] end
def dump_threads
still sending a heartbeat.
Useful if you have a frozen or deadlocked process which is
Signal this process to log backtraces for all threads.
def dump_threads signal("TTIN") end
def embedded?
def embedded? self["embedded"] end
def identity
def identity self["identity"] end
def initialize(hash)
- Api: - private
def initialize(hash) @attribs = hash end
def labels
def labels self["labels"].to_a end
def queues
def queues self["queues"] end
def quiet!
This method is *asynchronous* and it can take 5-10
It will continue to execute jobs it has already fetched.
Signal this process to stop processing new jobs.
def quiet! raise "Can't quiet an embedded process" if embedded? signal("TSTP") end
def signal(sig)
def signal(sig) key = "#{identity}-signals" Sidekiq.redis do |c| c.multi do |transaction| transaction.lpush(key, sig) transaction.expire(key, 60) end end end
def stop!
This method is *asynchronous* and it can take 5-10
It will shutdown within its configured :timeout value, default 25 seconds.
Signal this process to shutdown.
def stop! raise "Can't stop an embedded process" if embedded? signal("TERM") end
def stopping?
-
(Boolean)
- true if this process is quiet or shutting down
def stopping? self["quiet"] == "true" end
def tag
def tag self["tag"] end
def version
def version self["version"] end
def weights
def weights self["weights"] end