scripts

package
v0.0.0-...-3ca95c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2013 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeferMove = redis.NewScript(
	2,
	`local refs = redis.call("zrangebyscore", KEYS[1], 0, ARGV[1])
  if table.getn(refs) > 0 then
    redis.call("lpush", KEYS[2], unpack(refs))
    redis.call("zremrangebyscore", KEYS[1], 0, ARGV[1])
  end
  return refs`)

Move tasks from a deferred zset to the todo simpleq

View Source
var RecurPull = redis.NewScript(
	1,
	`local refs = redis.call("zrangebyscore", KEYS[1], 0, ARGV[1])
  for i,ref in pairs(refs) do
    local tref, interval = string.match(ref, "([^|]*)|([0-9]+)")
    redis.call("zincrby", KEYS[1], interval, ref)
    refs[i] = tref
  end
  return refs`)

Pull recurring tasks out of their zset Get their intervals and update the next processing time

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL