Parent

GirlFriday::Store::Redis

Public Class Methods

new(name, options) click to toggle source
# File lib/girl_friday/persistence.rb, line 24
def initialize(name, options)
  @opts = options
  raise ArgumentError, "you must pass in a :pool" unless @opts[:pool]
  @key = "girl_friday-#{name}-#{environment}"
end

Public Instance Methods

<<(work) click to toggle source
Alias for: push
pop() click to toggle source
# File lib/girl_friday/persistence.rb, line 36
def pop
  val = redis { |r| r.lpop(@key) }
  Marshal.load(val) if val
end
push(work) click to toggle source
# File lib/girl_friday/persistence.rb, line 30
def push(work)
  val = Marshal.dump(work)
  redis { |r| r.rpush(@key, val) }
end
Also aliased as: <<
size() click to toggle source
# File lib/girl_friday/persistence.rb, line 41
def size
  redis { |r| r.llen(@key) }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.