New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redis-scheduler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-scheduler

  • 0.9
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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 = Redis.new s = RedisScheduler.new r, blocking: true startt = Time.now s.schedule! "a", startt + 10 s.schedule! "b", startt + 15 s.schedule! "c", startt + 20 s.each { |item, at| puts "#{Time.now - startt}: #{item}" }

prints:

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

== Documentation

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

== Implementation

See http://masanjin.net/blog/using-redis-for-scheduling for some details.

== Bug reports

Please file bugs here: https://github.com/wmorgan/redis-scheduler/issues Please send comments to: wmorgan-redis-scheduler-readme@masanjin.net.

FAQs

Package last updated on 20 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc