yakischloba-em-cron 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/README +39 -0
  2. metadata +65 -0
data/README ADDED
@@ -0,0 +1,39 @@
1
+ em-cron
2
+
3
+ cron-style methods for timers in EventMachine
4
+
5
+ examples:
6
+
7
+ # Once per hour, starting now. Note the :now symbol must be passed for your block to be called immediately.
8
+ EM.do_hourly(:starting => :now) { puts "drink a beer" }
9
+
10
+ # Once per day, starting in 1 day.
11
+ EM.do_daily { puts "take a shower" }
12
+
13
+ # Once per week, starting in 10 hours
14
+ EM.do_weekly(:starting => 10.hours.from_now) { puts "take out the garbage" }
15
+
16
+ # Once per month, starting at this time tomorrow.
17
+ EM.do_monthly(:starting => 1.day.from_now) { puts "pay the bills" }
18
+
19
+ # Or you can simply pass a number of seconds til starting
20
+ EM.do_monthly(:starting => 2592000) { puts "pay the bills, in seconds!" }
21
+
22
+ # Leveraging the Chronic time parsing library. em-cron knows if you have required
23
+ # Chronic and uses it to parse strings if you have. Otherwise, it uses Time.parse.
24
+ #
25
+ # Every 2 hours, starting next Tuesday at 9AM.
26
+ require 'chronic'
27
+ EM.do(:every => 2.hours, :starting => 'next tuesday at 9am') { puts "go pee" }
28
+
29
+ # You can add up units of time as well
30
+ EM.do(:every => 1.minutes + 3.seconds) { puts "hi!" }
31
+
32
+
33
+ TODO:
34
+
35
+ Maintain a list of task signatures and their associated timer signatures so cron tasks can be canceled.
36
+
37
+
38
+ jakecdouglas@gmail.com
39
+ yakischloba on Freenode #eventmachine
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yakischloba-em-cron
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jake Douglas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-27 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: eventmachine
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description: cron-style methods for timers in EventMachine
26
+ email: jakecdouglas@gmail.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files: []
32
+
33
+ files:
34
+ - README
35
+ - lib/em-cron.rb
36
+ - lib/em-cron/numericmixable.rb
37
+ - lib/em-cron/em-cron.rb
38
+ has_rdoc: false
39
+ homepage: http://www.github.com/yakischloba/em-cron
40
+ post_install_message:
41
+ rdoc_options: []
42
+
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ version:
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ requirements: []
58
+
59
+ rubyforge_project: em-cron
60
+ rubygems_version: 1.2.0
61
+ signing_key:
62
+ specification_version: 2
63
+ summary: cron-style methods for timers in EventMachine
64
+ test_files: []
65
+