Module: Qless

Extended by:
Qless
Included in:
Qless
Defined in:
lib/qless/server.rb,
lib/qless.rb,
lib/qless/job.rb,
lib/qless/lua.rb,
lib/qless/queue.rb,
lib/qless/config.rb,
lib/qless/worker.rb,
lib/qless/version.rb,
lib/qless/job_reservers/ordered.rb,
lib/qless/job_reservers/round_robin.rb

Overview

Much of this is shamelessly poached from the resque web client

Defined Under Namespace

Modules: JobReservers Classes: BaseJob, Client, ClientEvents, ClientJobs, ClientQueues, ClientWorkers, Config, Job, Lua, Queue, QueueJobs, RecurringJob, Server, UnsupportedRedisVersionError, Worker

Constant Summary collapse

VERSION =
"0.9.2"

Instance Method Summary collapse

Instance Method Details

#generate_jidObject



15
16
17
# File 'lib/qless.rb', line 15

def generate_jid
  SecureRandom.uuid.gsub('-', '')
end

#stringify_hash_keys(hash) ⇒ Object



19
20
21
22
23
# File 'lib/qless.rb', line 19

def stringify_hash_keys(hash)
  hash.each_with_object({}) do |(key, value), result|
    result[key.to_s] = value
  end
end

#worker_nameObject

This is a unique identifier for the worker



26
27
28
# File 'lib/qless.rb', line 26

def worker_name
  @worker_name ||= [Socket.gethostname, Process.pid.to_s].join('-')
end