Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yakischloba-em-timers

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yakischloba-em-timers

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

em-timers

helper methods for timers in EventMachine

examples:

Once per hour, starting now. Note the :now symbol must be passed for your block to be called immediately.

EM.do_hourly(:starting => :now) { puts "drink a beer" }

Once per day, starting in 1 day.

EM.do_daily { puts "take a shower" }

Once per week, starting in 10 hours

EM.do_weekly(:starting => 10.hours.from_now) { puts "take out the garbage" }

Once per month, starting at this time tomorrow.

EM.do_monthly(:starting => 1.day.from_now) { puts "pay the bills" }

Or you can simply pass a number of seconds til starting

EM.do_monthly(:starting => 2592000) { puts "pay the bills, in seconds!" }

Leveraging the Chronic time parsing library. em-timers knows if you have required

Chronic and uses it to parse strings if you have. Otherwise, it uses Time.parse.

Every 2 hours, starting next Tuesday at 9AM.

require 'chronic' EM.do(:every => 2.hours, :starting => 'next tuesday at 9am') { puts "go pee" }

You can add up units of time as well

EM.do(:every => 1.minutes + 3.seconds) { puts "hi!" }

TODO:

Maintain a list of task signatures and their associated timer signatures so tasks can be canceled.

jakecdouglas@gmail.com yakischloba on Freenode #eventmachine

FAQs

Package last updated on 10 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