rufus-scheduler 3.3.4 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,58 +1,65 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-15 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: tzinfo
14
+ name: fugit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 1.1.1
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.1'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
32
+ version: 1.1.1
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rspec
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
37
+ - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: 2.13.0
39
+ version: '3.7'
34
40
  type: :development
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - ">="
44
+ - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: 2.13.0
46
+ version: '3.7'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: chronic
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ">="
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '0'
53
+ version: '0.10'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ">="
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '0'
55
- description: job scheduler for Ruby (at, cron, in and every jobs).
60
+ version: '0.10'
61
+ description: Job scheduler for Ruby (at, cron, in and every jobs). Not a replacement
62
+ for crond.
56
63
  email:
57
64
  - jmettraux@gmail.com
58
65
  executables: []
@@ -64,21 +71,13 @@ files:
64
71
  - LICENSE.txt
65
72
  - Makefile
66
73
  - README.md
67
- - TODO.txt
68
- - fail.txt
69
- - fail18.txt
70
74
  - lib/rufus-scheduler.rb
71
75
  - lib/rufus/scheduler.rb
72
- - lib/rufus/scheduler/cronline.rb
73
76
  - lib/rufus/scheduler/job_array.rb
74
77
  - lib/rufus/scheduler/jobs.rb
75
78
  - lib/rufus/scheduler/locks.rb
76
79
  - lib/rufus/scheduler/util.rb
77
- - lib/rufus/scheduler/zotime.rb
78
- - n.txt
79
- - pics.txt
80
80
  - rufus-scheduler.gemspec
81
- - sofia.md
82
81
  homepage: http://github.com/jmettraux/rufus-scheduler
83
82
  licenses:
84
83
  - MIT
@@ -91,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
90
  requirements:
92
91
  - - ">="
93
92
  - !ruby/object:Gem::Version
94
- version: '0'
93
+ version: '1.9'
95
94
  required_rubygems_version: !ruby/object:Gem::Requirement
96
95
  requirements:
97
96
  - - ">="
@@ -99,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
98
  version: '0'
100
99
  requirements: []
101
100
  rubyforge_project: rufus
102
- rubygems_version: 2.4.5.2
101
+ rubygems_version: 2.6.13
103
102
  signing_key:
104
103
  specification_version: 4
105
104
  summary: job scheduler for Ruby (at, cron, in and every jobs)
data/TODO.txt DELETED
@@ -1,151 +0,0 @@
1
-
2
- [o] merge schedule_queue and unschedule_queue (and merge [un]schedule steps)
3
- [x] OR stop using queue, since we've got the thread-safe JobArray
4
- [x] if possible, drop the mutex in JobArray
5
- NO, that mutex is necessary for Scheduler#jobs (on JRuby an co)...
6
- [o] named mutexes
7
- [o] drop the schedule queue, rely on the mutex in JobArray
8
- [o] def jobs; (@jobs.to_a + running_jobs).uniq; end
9
- [o] replace @unscheduled by @unscheduled_at
10
- [o] make sure #jobs doesn't return unscheduled jobs
11
- [o] job tags and find_by_tag(t) (as in rs 2.x)
12
- [o] require tzinfo anyway (runtime dep)
13
- [o] document frequency
14
- [o] accept :frequency => '5s'
15
- [o] timeout (as in rufus-scheduler 2.x)
16
- [o] Rufus::Scheduler#running_jobs (as in rufus-scheduler 2.x)
17
- [o] Rufus::Scheduler#terminate_all_jobs
18
- [o] Rufus::Scheduler::Job#kill
19
- [x] Rufus::Scheduler#kill_all_jobs
20
- [o] Rufus::Scheduler#shutdown(:terminate or :kill (or nothing))
21
- [o] RepeatJob #pause / #resume (think about discard past)
22
- [o] Rufus::Scheduler.start_new (backward comp) (with deprec note?)
23
- [o] pass job to scheduled block? What does rs 2.x do?
24
- [o] :first[_in|_at] for RepeatJob
25
- [o] :last[_in|_at] for RepeatJob
26
- [o] :times for RepeatJob (how many recurrences)
27
- [o] fix issue #39 (first_at parses as UTC)
28
- [o] about issue #43, raise if cron/every job frequency < scheduler frequency
29
- [o] unlock spec/parse_spec.rb:30 "parse datimes with timezones"
30
- [o] some kind of Schedulable (Xyz#call(job, time))
31
- [o] add Jruby and Rubinius to Travis
32
- [o] make Job #first_at= / #last_at= automatically parse strings?
33
- [o] bring in Kratob's spec about mutex vs timeout and adapt 3.0 to it,
34
- https://github.com/jmettraux/rufus-scheduler/pull/67
35
- [x] :unschedule_if => lambda { |job| ... }
36
- [o] OR look at how it was done in rs 2.0.x, some return value?
37
- no, pass the job as arg to the block, then let the block do job.unschedule
38
- so, document schedule.every('10d') { |j| j.unschedule if x?() }
39
- [x] remove the time in job.trigger(time)
40
- [o] add spec for job queued then unscheduled
41
- [o] add spec for Scheduler#shutdown and work threads
42
- [o] at some point, bring back rbx19 to Travis
43
- [o] move the parse/util part of scheduler.rb to util.rb
44
- [o] rescue KillSignal in job thread loop to kill just the job
45
- [o] add spec for raise if scheduling a job while scheduler is shutting down
46
- [o] schedule_in(2.days.from_now) {}
47
- at and in could understand each others time parameter, ftw...
48
- use the new #parse_to_time? no
49
- [o] do repeat jobs reschedule after timing out? yes
50
- [o] schedule_interval('20s')?
51
- [x] Scheduler#reschedule(job) (new copy of the job)
52
- [x] #free_all_work_threads is missing an implementation
53
- [x] rescue StandardError
54
- :on_error => :crash[_scheduler]
55
- :on_error => :ignore
56
- :on_error => ...
57
- [o] on_error: what about TimeoutError in that scheme?
58
- TimeoutError goes to $stderr, like a normal error
59
- [o] link to SO for support
60
- - sublink to "how to report bugs effectively"
61
- [o] link to #ruote for support
62
- [x] lockblock? pass a block to teach the scheduler how to lock?
63
- is not necessary, @scheduler = Scheduler.new if should_start?
64
- the surrounding Ruby code checks
65
- [o] introduce job "vars", as in
66
- http://stackoverflow.com/questions/18202848/how-to-have-a-variable-that-will-available-to-particular-scheduled-task-whenever
67
- or job['key'] Job #[] and #[]=, as with Thread #[] #[]=
68
- job-local variables #keys #key?
69
- [o] thread-safety for job-local variables?
70
- [x] discard past? discard_past => true or => "1d"
71
- default would be discard_past => "1m" or scheduler freq * 2 ?
72
- jobs would adjust their next_time until it fits the window...
73
- ~~ discard past by default
74
- [o] expanded block/schedulable (it's "callable")
75
- ```
76
- scheduler.every '10m' do
77
- def pre
78
- return false if Backend.down?
79
- # ...
80
- end
81
- def post
82
- # ...
83
- end
84
- def trigger
85
- puts "oh hai!"
86
- end
87
- end
88
- ```
89
- or something like that...
90
- ...
91
- OR accept a class (and instantiate it the first time)
92
- ```
93
- scheduler.every '10m', Class.new do
94
- def call(job, time)
95
- # ...
96
- end
97
- end
98
- ```
99
- the job contains the instance in its @callable
100
- [x] add spec case for corner case in Job#trigger (overlap vs reschedule) !!!
101
- [o] rethink job array vs job set for #scheduled?
102
- [x] introduce common parent class for EveryJob and IntervalJob
103
- [o] create spec/ at_job_spec.rb, repeat_job_spec.rb, cron_job_spec.rb, ...
104
- [x] ensure EveryJob do not schedule in the past (it's already like that)
105
- [o] CronLine#next_time should return a time with subseconds chopped off
106
- [o] drop min work threads setting?
107
- [o] thread pool something? Thread upper limit?
108
- [o] Rufus::Scheduler.singleton, Rufus::Scheduler.s
109
- [o] EveryJob#first_at= and IntervalJob#first_at= should alter @next_time
110
- [o] scheduler.schedule duration/time/cron ... for at/in/cron
111
- (not every, nor interval)
112
- scheduler.repeat time/cron ... for every/cron
113
-
114
- [o] :lockfile => x, timestamp, process_id, thread_id...
115
- warning: have to clean up that file on exit... or does the scheduler
116
- timestamps it?
117
- [ ] develop lockfile timestamp thinggy
118
- ~ if the timestamp is too old (twice the default frequency?) then
119
- lock [file] take over...
120
- Is that really what we want all the time?
121
-
122
- [ ] idea: :mutex => x and :skip_on_mutex => true ?
123
- would prevent blocking/waiting for the mutex to get available
124
- :mutex => [ "mutex_name", true ]
125
- :mutex => [ [ "mutex_name", true ], [ "other_mutex_name", false ] ]
126
-
127
- [ ] bring back EM (but only EM.defer ?) :defer => true (Job or Scheduler
128
- or both option?)
129
-
130
- [ ] prepare a daemon, trust daemon-kit for that
131
-
132
- [ ] :if => lambda { |job, time| ... } why not?
133
- :unless => lambda { ...
134
- :block => lambda { ...
135
- can help get the block themselves leaner
136
- #
137
- investigate guards for schedulables... def if_guard; ...; end
138
-
139
- [ ] scheduler.every '10', Class.new do
140
- def call(job, time)
141
- # might fail...
142
- end
143
- def on_error(err, job)
144
- # catches...
145
- end
146
- end
147
-
148
- ~~~
149
-
150
- [ ] scheduler.at('chronic string', chronic_options...)
151
-
data/fail.txt DELETED
@@ -1,2 +0,0 @@
1
- rspec ./spec/job_spec.rb:465 # Rufus::Scheduler::Job :mutex :mutex => [ array_of_mutex_names_or_instances ] prevents concurrent executions
2
- rspec ./spec/scheduler_spec.rb:534 # Rufus::Scheduler#running_jobs(:tag/:tags => x) returns a list of running jobs filtered by tag
data/fail18.txt DELETED
@@ -1,12 +0,0 @@
1
-
2
- rspec ./spec/job_spec.rb:640 # Rufus::Scheduler::Job work time #mean_work_time gathers work times and computes the mean
3
- rspec ./spec/schedule_at_spec.rb:60 # Rufus::Scheduler#at triggers a job
4
- rspec ./spec/schedule_in_spec.rb:44 # Rufus::Scheduler#in removes the job after execution
5
- rspec ./spec/scheduler_spec.rb:83 # Rufus::Scheduler a schedule method passes the job to its block when it triggers
6
- rspec ./spec/scheduler_spec.rb:534 # Rufus::Scheduler#running_jobs(:tag/:tags => x) returns a list of running jobs filtered by tag
7
- rspec ./spec/scheduler_spec.rb:601 # Rufus::Scheduler#occurrences(time0, time1) respects :times for repeat jobs
8
- rspec ./spec/scheduler_spec.rb:1019 # Rufus::Scheduler#on_post_trigger is called right after a job triggers
9
-
10
-
11
- determine_id specs are slower... much slower...
12
-