procrastinator 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9d61dca76d919b7ece43fd8b7b59c9256cb8334
4
- data.tar.gz: 70251bb840acfa728d0fbb1cf5b457364dd655ac
3
+ metadata.gz: d901bb20f0f835751317df344bcb9d44a112d664
4
+ data.tar.gz: a00d3089e9218e6cffa5faefa6874c73a18737fc
5
5
  SHA512:
6
- metadata.gz: ffbb42494ee062144f658b11a9c936072432c411e0aae2f43ca7a7b561b8272f445d8a8017b4b708c06463fdd2bc276a8f869ee4506576f5d521fa2a17280d4f
7
- data.tar.gz: 3afb4512571a8e49530bb05726cd4628636f10925791967fe789b11a536a2c48df87d9d0311af7e2a8066ccb41698c0d8b50f15cb9080525b9a7081de130bb00
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| # MyTaskPersister is a class defined by you
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, and each process is 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. Tasks are chosen by their `:run_at` property.
93
+ Each queue is worked in a separate process.
94
94
 
95
- The sub-processes check ervey 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.
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.|env|define_queue(:cleanup)
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
@@ -1,3 +1,3 @@
1
1
  module Procrastinator
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
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.1
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-03 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler