queue-processor 0.0.8 → 0.0.9
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d2e7fef7f7adcfdd5d402fb467c506488d1e3044dd0de5a539c092b38aba122
|
4
|
+
data.tar.gz: 36a845eaf360cba10f10aa23704268ac8f8b4130852882dd3f44c4356dab4049
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73103cfe287c7a0bbe9e87f798c4ccd4e227df2ba0f4ae03deaf8714d645ef8602ac603db9b9e988bb7b44ef88eb8a55113636c2cff57d604a6518e8eef501e5
|
7
|
+
data.tar.gz: '055883690b2be2f31a7be6d7097aa049ef3da272e84812d8683ad5d3c16c543e1eda94816b91ab25a8126784d944d316a4423a0b6ca7e340871093c13889e3bd'
|
data/README.md
CHANGED
@@ -40,7 +40,7 @@ class WeeklyCalculation < ActiveRecord::Base
|
|
40
40
|
|
41
41
|
# Required hook to perform the calculation associated with the Root Calculation
|
42
42
|
def perform_calculation
|
43
|
-
|
43
|
+
update(:computed_value => rand())
|
44
44
|
end
|
45
45
|
|
46
46
|
# Required hook to create and queue the dependent work
|
@@ -95,7 +95,7 @@ class HourlyCalculation < ActiveRecord::Base
|
|
95
95
|
|
96
96
|
# Required hook that computes the hourly value
|
97
97
|
def perform_calculation
|
98
|
-
|
98
|
+
update(:computed_value => rand())
|
99
99
|
end
|
100
100
|
end
|
101
101
|
```
|
@@ -16,7 +16,7 @@ module QueueProcessor
|
|
16
16
|
unless parent_calculation && parent_calculation.should_cancel?
|
17
17
|
self.perform_calculation
|
18
18
|
end
|
19
|
-
self.
|
19
|
+
self.update(:completed => true)
|
20
20
|
Rails.logger.debug {"#{self.describe}: is done"}
|
21
21
|
|
22
22
|
parent_calculation&.fire_events(:finish)
|
@@ -5,7 +5,7 @@ module QueueProcessor
|
|
5
5
|
|
6
6
|
def reset_state_machines!
|
7
7
|
reload
|
8
|
-
|
8
|
+
update(:processing_at => nil,:calculation_state => 'available', :dependent_calculations_state => 'idle', :processing_state => 'idle')
|
9
9
|
end
|
10
10
|
|
11
11
|
def stuck?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queue-processor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Naegle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
117
|
+
rubygems_version: 3.2.22
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: A processing model for a main calculation and a set of dependent calculations.
|