class QPush::Web::Apis::QueueDelayed

Public Class Methods

new(id, score) click to toggle source
# File lib/qpush/web/apis/queue_delayed.rb, line 5
def initialize(id, score)
  @id = id
  @score = score
end

Public Instance Methods

call() click to toggle source
# File lib/qpush/web/apis/queue_delayed.rb, line 10
def call
  Web.redis do |conn|
    @conn = conn
    watch_delay { retrieve_delay }
  end
end

Private Instance Methods

retrieve_delay() click to toggle source
# File lib/qpush/web/apis/queue_delayed.rb, line 19
def retrieve_delay
  delays = @conn.zrangebyscore(Web.keys[:delay], @score, @score)
  delays.each

# Performs a watch on our delay list
#
def watch_delay
  @conn.watch(Web.keys[:delay]) do
    yield if block_given?
  end
watch_delay() { || ... } click to toggle source

Performs a watch on our delay list

# File lib/qpush/web/apis/queue_delayed.rb, line 25
def watch_delay
  @conn.watch(Web.keys[:delay]) do
    yield if block_given?
  end
end