Skip to content
A simple, production-ready chronological scheduler for Redis.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A simple, production-ready chronological scheduler for Redis. It allows you to
schedule items to be processed at arbitrary points in the future, and easily
retrieve only those items that are due to be processed.

It does everything you'd expect from a production scheduler:
* You can schedule arbitrary items at arbitrary times.
* You can iterate over ready items in either blocking or non-blocking mode.
* It supports multiple concurrent producers and consumers.
* An application exception causes the item to be rescheduled at the original time.
* Work items lost as part of an application crash or segfault are recoverable.

In non-blocking mode, RedisScheduler#each will iterate over only those items
whose scheduled time is less than or equal to the current time, and then stop.
In blocking mode, RedisScheduler#each will additionally wait until further
items are available. In nonblocking mode, #each will never return.

For debugging purposes, you can use RedisScheduler#items to iterate over all
items in the queue. Note that this method is not guaranteed to be consistent in
the presence of contemporaneous producers or consumers.

For error recovery purposes, you can use RedisScheduler#processing_set_items
to iterate over all the items in the processing set to determine whether any
of them are the result of a process crash.

== Synopsis

  r =
  s = r, blocking: true
  startt =
  s.schedule! "a", startt + 10
  s.schedule! "b", startt + 15
  s.schedule! "c", startt + 20
  s.each { |item, at| puts "#{ - startt}: #{item}" }


  10.03481788: a
  15.05255288: b
  20.06058172: c
  ... waits forever ...

== Documentation

See RedisScheduler's #initiatilize, schedule! and #each methods.

== Implementation

See for some details.

== Bug reports

Please file bugs here:
Please send comments to:
You can’t perform that action at this time.