procrastinator 0.2.1 → 0.2.2
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.
- checksums.yaml +4 -4
- data/README.md +7 -5
- data/lib/procrastinator/task_worker.rb +1 -1
- data/lib/procrastinator/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: d901bb20f0f835751317df344bcb9d44a112d664
|
4
|
+
data.tar.gz: a00d3089e9218e6cffa5faefa6874c73a18737fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88229261200f596e4c74d8ed2870dc0f4a558755f9edd4522300edc7f321ab9bf390b940a1cad95b0af5e410ef82ee2ab13ab50ba6da106fb1f23b6a2f835950
|
7
|
+
data.tar.gz: 82b596154acf8c935ad5014e098e5e319789ba5372fc3a492cb2adebe3e6544d704a48ad181161f37691904e2803fdb83b771bac811b71b9710d0be831d387bb
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Or install it yourself as:
|
|
23
23
|
Setup a procrastination environment:
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
procrastinator = Procrastinator.setup(TaskPersister.new) do |env|
|
26
|
+
procrastinator = Procrastinator.setup(TaskPersister.new) do |env|
|
27
27
|
env.define_queue(:email)
|
28
28
|
env.define_queue(:cleanup, max_attempts: 3)
|
29
29
|
end
|
@@ -90,9 +90,11 @@ end
|
|
90
90
|
```
|
91
91
|
|
92
92
|
#### Queue Sub-Processes
|
93
|
-
Each queue is worked in a separate process
|
93
|
+
Each queue is worked in a separate process.
|
94
94
|
|
95
|
-
|
95
|
+
<!-- , and each process multi-threaded to handle more than one task at a time. This should help prevent a single task from clogging up the whole queue, or a single queue clogging up the entire system. -->
|
96
|
+
|
97
|
+
The sub-processes check every 5 seconds that the parent process is still alive. If there is no process with the parent's process ID, the sub-process will self-exit.
|
96
98
|
|
97
99
|
###`Environment#delay`
|
98
100
|
When there are multiple queues defined, you are required to provide a queue name:
|
@@ -100,7 +102,7 @@ When there are multiple queues defined, you are required to provide a queue name
|
|
100
102
|
```ruby
|
101
103
|
procrastinator = Procrastinator.setup(task_persister) do |env|
|
102
104
|
env.define_queue(:email)
|
103
|
-
env
|
105
|
+
env.define_queue(:cleanup)
|
104
106
|
end
|
105
107
|
|
106
108
|
procrastinator.delay(:email, task: EmailReminder.new('bob@example.com'))
|
@@ -182,4 +184,4 @@ version number in `version.rb`, and then run `bundle exec rake release`, which w
|
|
182
184
|
push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
183
185
|
|
184
186
|
## License
|
185
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
187
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -19,7 +19,7 @@ module Procrastinator
|
|
19
19
|
@initial_run_at = initial_run_at.to_i
|
20
20
|
@expire_at = expire_at.nil? ? nil : expire_at.to_i
|
21
21
|
@task = YAML.load(task)
|
22
|
-
@attempts = attempts
|
22
|
+
@attempts = attempts || 0
|
23
23
|
@max_attempts = max_attempts
|
24
24
|
@timeout = timeout
|
25
25
|
@last_fail_at = last_fail_at
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procrastinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|