day_planner 0.0.3 → 0.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -4
- data/lib/day_planner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba232608de836dc7719d47a3e0f78cf666bf2959
|
4
|
+
data.tar.gz: 27f627cf08e43c49920dc264b08e68515bd57b49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5b6e762927a4d64dc2b1787fc77af13c43a45cc70235a19d94e3523491b7eff1272dff13f1f795e4e3deffc3d409181f20cd06c268b212cfe399d05525f76c2
|
7
|
+
data.tar.gz: 08ab525349d6e9b54a840c6e86ddd95b0f6e380604fdc1dcb76de2ec2f0a2223d6eefd2494437f77cea215544e9a58570f314d1b4281e11452c0cb289d52a630
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# DayPlanner
|
2
2
|
|
3
|
-
Day Planner is a simple tool to manage in-process execution of scheduled tasks. There are a lot of tools for running scheduled tasks outside the process ([Clockwork](http://rubygems.org/gems/clockwork) is probably what you're looking for if you want an elegant implementation of scheduled tasks outside the main process.
|
3
|
+
Day Planner is a simple tool to manage in-process execution of scheduled tasks. There are a lot of tools for running scheduled tasks outside the process ([Clockwork](http://rubygems.org/gems/clockwork) is probably what you're looking for if you want an elegant implementation of scheduled tasks outside the main process).
|
4
4
|
|
5
5
|
I wrote this because I needed a simple, lightweight tool to schedule small, light tasks on an application running on Heroku, without the extra cost of a dedicated clock process to handle it, but executing more frequently than Heroku's free scheduler permits.
|
6
6
|
|
@@ -24,7 +24,7 @@ If you're using Rails, it'll expect to find a file listing scheduled tasks in 'c
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
-
Here's an example of a scheduled task:
|
27
|
+
Here's an example of a scheduled task, living in (app)/config/day_planner_tasks.rb (this is the required/automatic location of the schedule file if you're using Rails):
|
28
28
|
|
29
29
|
DayPlanner.schedule(every: 2.minutes) do
|
30
30
|
MyClass.my_class_method
|
@@ -34,6 +34,8 @@ Obviously you only get those cute little time methods in Rails; otherwise, pass
|
|
34
34
|
|
35
35
|
The tasks in the schedule will each be performed on startup and then thereafter according to their stated intervals.
|
36
36
|
|
37
|
+
I'm not doing a whole damn ton to protect you from tasks that throw errors, but there is a begin/rescue/end up in there at some point. I definitely am not protecting you from a process that just won't end or anything like that. Given that each task is run in its own thread, you have reasonable assurance that they are occuring at whatever interval you specify plus a very small amount of overhead.
|
38
|
+
|
37
39
|
By default, DayPlanner checks for tasks to be performed once per minute. You have the power to change this:
|
38
40
|
|
39
41
|
DayPlanner.interval = 5.seconds
|
@@ -42,9 +44,13 @@ Or, like
|
|
42
44
|
|
43
45
|
DayPlanner.interval = 5
|
44
46
|
|
45
|
-
Note that if you try to schedule a task with an interval shorter than DayPlanner's interval, it'll complain and fail. If you shorten DayPlanner's interval to less than that of one of its tasks, it'll
|
47
|
+
Note that if you try to schedule a task with an interval shorter than DayPlanner's interval, it'll complain and fail. If you shorten DayPlanner's interval to less than that of one of its tasks, it'll complain but not fail. It obviously will only run at scheduler thread's intervals. Use your best judgment.
|
48
|
+
|
49
|
+
Specify your preferred interval (and whatever other goodies may be waiting in the pipeline) in config/day_planner_tasks.rb. Note that you probably won't manage to precede that first minute-long wait. I may default to a shorter value in the future. I dunno. Don't pressure me.
|
50
|
+
|
51
|
+
### Non-Rails uses
|
46
52
|
|
47
|
-
|
53
|
+
I sort of think it might work without Rails, keeping in mind the various aforementioned caveats? I'm not really sure. If it totally doesn't, I'd appreciate feedback.
|
48
54
|
|
49
55
|
## Contributing
|
50
56
|
|
data/lib/day_planner/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: day_planner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.3
|
4
|
+
version: 0.0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damon Siefert
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.0.
|
78
|
+
rubygems_version: 2.0.3
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Built to have a way to schedule tasks without running an extra process and
|