module SimpleWorker::RedisSupport

Attributes

jobid[R]
namespace[R]

Private Instance Methods

active_tasks_key() click to toggle source
# File lib/simpleworker/redis_support.rb, line 17
def active_tasks_key
  @active_tasks_key ||= "#{namespace}:active:#{jobid}"
end
config_key() click to toggle source
# File lib/simpleworker/redis_support.rb, line 21
def config_key
  @config_key ||= "#{namespace}:config:#{jobid}"
end
load_lua_scripts() click to toggle source
# File lib/simpleworker/redis_support.rb, line 25
def load_lua_scripts
  path_to_lua_scripts = File.expand_path("scripts/", File.dirname(__FILE__))
  ['lpopall', 'expired_tasks', 'reliable_queue'].each do |name|
    sha = @redis.script(:load, IO.read("#{path_to_lua_scripts}/#{name}.lua"))
    instance_variable_set("@#{name}_sha", sha)
  end
end
log_key() click to toggle source
# File lib/simpleworker/redis_support.rb, line 13
def log_key
  @log_key ||= "#{namespace}:log:#{jobid}"
end
tasks_key() click to toggle source
# File lib/simpleworker/redis_support.rb, line 9
def tasks_key
  @tasks_key ||= "#{namespace}:tasks:#{jobid}"
end